Skip to content

Commit b20955e

Browse files
committed
fix: ASAN
1 parent fc7a11b commit b20955e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quickjs.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -8892,14 +8892,16 @@ static int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj, JSAtom prop,
88928892
if (JS_IsFunction(ctx, val)) {
88938893
JSObject *vf = JS_VALUE_GET_OBJ(val);
88948894
if (vf->class_id == JS_CLASS_BYTECODE_FUNCTION) {
8895-
const char* name = get_func_name(ctx, val);
8895+
const char *name = get_func_name(ctx, val);
8896+
if(name != NULL) {
88968897
if (strcmp(name, "") == 0) {
88978898
JSValue js_value = JS_AtomToValue(ctx, prop);
88988899
JS_DefinePropertyValue(ctx, val, JS_ATOM_name, js_value, JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE);
88998900
JS_FreeValue(ctx, js_value);
89008901
}
89018902

89028903
JS_FreeCString(ctx, name);
8904+
}
89038905
}
89048906
}
89058907

0 commit comments

Comments
 (0)