Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1bcd0f

Browse files
committed
Avoid warnings; subtler debug output levels
1 parent 7d1750e commit c1bcd0f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Python/optimizer.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ translate_bytecode_to_trace(
315315
if (uop_debug != NULL && *uop_debug >= '0') {
316316
lltrace = *uop_debug - '0'; // TODO: Parse an int and all that
317317
}
318-
if (lltrace >= 2) {
318+
if (lltrace >= 4) {
319319
fprintf(stderr,
320320
"Optimizing %s (%s:%d) at offset %ld\n",
321321
PyUnicode_AsUTF8(code->co_qualname),
@@ -363,17 +363,18 @@ translate_bytecode_to_trace(
363363
goto done;
364364
}
365365
for (int i = 0; i < nuops; i++) {
366+
int offset = expansion->uops[i].offset;
366367
switch (expansion->uops[i].size) {
367368
case 0:
368369
break;
369370
case 1:
370-
oparg = read_u16(instr + expansion->uops[i].offset);
371+
oparg = read_u16(&instr[offset].cache);
371372
break;
372373
case 2:
373-
oparg = read_u32(instr + expansion->uops[i].offset);
374+
oparg = read_u32(&instr[offset].cache);
374375
break;
375376
case 4:
376-
oparg = read_u64(instr + expansion->uops[i].offset);
377+
oparg = read_u64(&instr[offset].cache);
377378
break;
378379
default:
379380
fprintf(stderr,
@@ -414,7 +415,7 @@ translate_bytecode_to_trace(
414415
}
415416
else {
416417
#ifdef LLTRACE
417-
if (lltrace >= 2) {
418+
if (lltrace >= 4) {
418419
fprintf(stderr,
419420
"No trace for %s (%s:%d) at offset %ld\n",
420421
PyUnicode_AsUTF8(code->co_qualname),

0 commit comments

Comments
 (0)