summaryrefslogtreecommitdiffhomepage
path: root/src/debug.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-01-06 17:06:07 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-01-06 17:06:07 +0900
commit74c9502bd45fd70926c86ce564c2d5d1df9a6dd0 (patch)
tree4dbf22f15e482bf082712286bcf0daa5e51aa41c /src/debug.c
parent1341e53961b3e99ac67d803e5ead677e976d18c4 (diff)
parent456878ba06358a77d4ab9312fdc69bf780f8fdf4 (diff)
downloadmruby-74c9502bd45fd70926c86ce564c2d5d1df9a6dd0.tar.gz
mruby-74c9502bd45fd70926c86ce564c2d5d1df9a6dd0.zip
Merge branch 'improve-source-scanning-for-presym' of https://github.com/shuujii/mruby into shuujii-improve-source-scanning-for-presym
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug.c b/src/debug.c
index c03c91cf5..2f9320ac9 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -66,7 +66,7 @@ mrb_debug_get_filename(mrb_state *mrb, const mrb_irep *irep, uint32_t pc)
MRB_API int32_t
mrb_debug_get_line(mrb_state *mrb, const mrb_irep *irep, uint32_t pc)
{
- if (irep && pc < irep->ilen) {
+ if (irep && pc >= 0 && pc < irep->ilen) {
mrb_irep_debug_info_file* f = NULL;
if (!irep->debug_info) {
return -1;