1
0
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:
Calvin Rose
2023-06-01 13:01:59 -05:00
parent 26a113927e
commit e97299fc65
2 changed files with 19 additions and 1 deletions

View File

@@ -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)