Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes in duk__handle_oldenv_for_call when using #undef DUK_USE_FUNC_NAME_PROPERTY #2573

Open
copilotenstar opened this issue Nov 23, 2024 · 0 comments

Comments

@copilotenstar
Copy link

#undef DUK_USE_FUNC_NAME_PROPERTY

if (duk_pcompile_lstring(ctx, DUK_COMPILE_EVAL, scriptbuf, size)) == 0) {
    duk_dump_function(ctx);
    size_t sz = 0;
    void* buffer = duk_get_buffer(ctx, -1, &sz);

    duk_load_function(ctx);
    duk_pcall(ctx, 0);
}
D1 duk_api_bytecode.c:676 (duk__load_func): no _Formals in dumped function
D1 duk_api_bytecode.c:680 (duk__load_func): final loaded function: {length/564:0,_Varmap/207:{object/generic 000002EC8DD69EA0},__extensible:true,__compfunc:true,__data:buffer:fixed:4736/1,__lexenv:NULL,__varenv:NULL,__nregs:14,__nargs:0,__data:buffer:fixed:4736/1,__refcount:1,__class:3,__heapptr:000002EC8DCEEF90,__prototype:000002EC8DCEFAE8}
D2 duk_heap_refcount.c:627 (duk__heaphdr_refzero_helper): ms_running=0, heap_thread=000002EC8DCEED20
D2 duk_heap_alloc.c:83 (duk_free_hbuffer): free dynamic buffer 000002EC8DD4B118
D1 duk_js_call.c:2703 (duk_handle_safe_call): duk_handle_safe_call: thr=000002EC8DCEED20, num_stack_args=1, num_stack_rets=1, valstack_top=1, idx_retbase=0, rec_depth=0/1000, entry_act=NULL, entry_valstack_bottom_byteoff=0, entry_call_recursion_depth=0, entry_curr_thread=NULL, entry_thread_state=1
D2 duk_js_call.c:2722 (duk_handle_safe_call): safe_call setjmp catchpoint setup complete
D2 duk_api_stack.c:1183 (duk_insert): duk_insert: to_idx=1, p=000002EC8DD3A1A0, q=000002EC8DD3A1A0, nbytes=0
D1 duk_js_call.c:2051 (duk__handle_call_raw): duk__handle_call_raw: thr=000002EC8DCEED20, idx_func=0, call_flags=0x00000000 (constructor=0), valstack_top=2, idx_func=0, idx_args=2, rec_depth=1/1000, entry_valstack_bottom_byteoff=0, entry_valstack_end_byteoff=7616, entry_call_recursion_depth=1, entry_curr_thread=000002EC8DCEED20, entry_thread_state=2
D2 duk_js_call.c:1116 (duk__coerce_nonstrict_this_binding): this binding: non-strict, undefined/null -> use global object
D2 duk_js_call.c:2086 (duk__handle_call_raw): fast path target resolve
D2 duk_js_call.c:1692 (duk__call_setup_act_not_tailcall): not a tail call, pushing a new activation to callstack, to index 0
D0 duk_error_macros.c:176 (duk_default_fatal_handler): built-in default fatal error handler called: assertion failed: h_lex != NULL (duk_js_call.c:981)

if I #define DUK_USE_FUNC_NAME_PROPERTY it works fine.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant