Skip to content

Commit 5397d3d

Browse files
committed
fix: ASAN
1 parent 393c331 commit 5397d3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: quickjs.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -8887,14 +8887,16 @@ static int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj, JSAtom prop,
88878887
if (JS_IsFunction(ctx, val)) {
88888888
JSObject *vf = JS_VALUE_GET_OBJ(val);
88898889
if (vf->class_id == JS_CLASS_BYTECODE_FUNCTION) {
8890-
const char* name = get_func_name(ctx, val);
8890+
const char *name = get_func_name(ctx, val);
8891+
if(name != NULL) {
88918892
if (strcmp(name, "") == 0) {
88928893
JSValue js_value = JS_AtomToValue(ctx, prop);
88938894
JS_DefinePropertyValue(ctx, val, JS_ATOM_name, js_value, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);
88948895
JS_FreeValue(ctx, js_value);
88958896
}
88968897

88978898
JS_FreeCString(ctx, name);
8899+
}
88988900
}
88998901
}
89008902

0 commit comments

Comments
 (0)