mirror of
https://github.com/janet-lang/janet
synced 2025-10-16 00:07:40 +00:00
Fix #1174 - bad debug info causing stack traversal to segfault.
Coming from commit 77189b6e66
, relating
to changes in source mapping debug info, this caused a segfault when
traversing a stack frame where the birth_pc was incredibly large due
to wrap around. This fix prevents the wrap around and does saturating
subtraction to 0.
This commit is contained in:
@@ -47,4 +47,15 @@
|
||||
|
||||
(assert (= 10 (do (var x 10) (def y x) (++ x) y)) "no invalid aliasing")
|
||||
|
||||
# Crash issue #1174 - bad debug info
|
||||
(defn crash []
|
||||
(debug/stack (fiber/current)))
|
||||
(do
|
||||
(math/random)
|
||||
(defn foo [_]
|
||||
(crash)
|
||||
1)
|
||||
(foo 0)
|
||||
10)
|
||||
|
||||
(end-suite)
|
||||
|
Reference in New Issue
Block a user