Skip to content

Commit 1f52859

Browse files
AirCity456pikasTech
authored andcommitted
fix(pikaobj): move name_buff from conditional block to function scope in
the obj_saveMethodInfo function. Moved name_buff out of the inner if block so its storage duration covers all code paths. This prevents using pointers to a transient buffer that previously led to: 1. method name/hash mismatches 2. intermittent NameError on lookups 3. misleading integrity diagnostics
1 parent 0571919 commit 1f52859

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PikaObj.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,8 @@ static void obj_saveMethodInfo(PikaObj* self, MethodInfo* tInfo) {
11911191
.host_obj = NULL,
11921192
};
11931193
char* name = tInfo->name;
1194+
char name_buff[PIKA_LINE_BUFF_SIZE / 2] = {0};
11941195
if (NULL == tInfo->name) {
1195-
char name_buff[PIKA_LINE_BUFF_SIZE / 2] = {0};
11961196
name = strGetFirstToken(name_buff, tInfo->dec, '(');
11971197
}
11981198
/* the first arg_value */

0 commit comments

Comments
 (0)