Skip to content

Commit

Permalink
fix: ASAN
Browse files Browse the repository at this point in the history
  • Loading branch information
gengjiawen committed Feb 9, 2025
1 parent 393c331 commit 5397d3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -8887,14 +8887,16 @@ static int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj, JSAtom prop,
if (JS_IsFunction(ctx, val)) {
JSObject *vf = JS_VALUE_GET_OBJ(val);
if (vf->class_id == JS_CLASS_BYTECODE_FUNCTION) {
const char* name = get_func_name(ctx, val);
const char *name = get_func_name(ctx, val);
if(name != NULL) {
if (strcmp(name, "") == 0) {
JSValue js_value = JS_AtomToValue(ctx, prop);
JS_DefinePropertyValue(ctx, val, JS_ATOM_name, js_value, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);
JS_FreeValue(ctx, js_value);
}

JS_FreeCString(ctx, name);
}
}
}

Expand Down

0 comments on commit 5397d3d

Please sign in to comment.