mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Don't segfault on missing line number data (#641)
Can be reproduced on the CLI but not from a script: # should throw "unsupported object class" TypeError $ qjs --std -e 'bjson.write(function(){})' /path/to/quickjs.c:6510:15: runtime error: applying zero offset to null pointer
This commit is contained in:
parent
56e5ffa2db
commit
42262a7c53
1 changed files with 2 additions and 0 deletions
|
@ -6507,6 +6507,8 @@ static int find_line_num(JSContext *ctx, JSFunctionBytecode *b,
|
|||
|
||||
*col = 1;
|
||||
p = b->pc2line_buf;
|
||||
if (!p)
|
||||
goto fail;
|
||||
p_end = p + b->pc2line_len;
|
||||
pc = 0;
|
||||
line_num = b->line_num;
|
||||
|
|
Loading…
Reference in a new issue