mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
debug.c (mrb_debug_get_position): do not keep lp and fp uninitialized
This commit is contained in:
+2
-5
@@ -159,11 +159,7 @@ mrb_debug_get_line(mrb_state *mrb, const mrb_irep *irep, uint32_t pc)
|
||||
MRB_API mrb_bool
|
||||
mrb_debug_get_position(mrb_state *mrb, const mrb_irep *irep, uint32_t pc, int32_t *lp, const char **fp)
|
||||
{
|
||||
if (irep && pc < irep->ilen) {
|
||||
if (!irep->debug_info) {
|
||||
*lp = -1; *fp = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
if (irep && pc < irep->ilen && irep->debug_info) {
|
||||
mrb_irep_debug_info_file *f = get_file(irep->debug_info, pc);
|
||||
*lp = debug_get_line(mrb, f, pc);
|
||||
if (*lp > 0) {
|
||||
@@ -171,6 +167,7 @@ mrb_debug_get_position(mrb_state *mrb, const mrb_irep *irep, uint32_t pc, int32_
|
||||
if (*fp) return TRUE;
|
||||
}
|
||||
}
|
||||
*lp = -1; *fp = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user