out_string(lvl == level - 1 ? last ? sym->last_2 : sym->branch_2 :
more[lvl + 1] ? sym->vert_2 : sym->empty_2);
条件表达式执行顺利:
lvl == level - 1 ? last ? sym->last_2 : sym->branch_2 : more[lvl + 1] ? sym->vert_2 : sym->empty_2
= (lvl == level - 1) ? (last ? sym->last_2 : sym->branch_2) : (more[lvl + 1] ? sym->vert_2 : sym->empty_2)
反编译汇编代码:
403eb0: f94022c2 ldr x2, [x22, #64] // x2=[0x43c288+64]=[0x43c2c8]=0x43c308=sym403eb4: 6b17039f cmp w28, w23 // w23=lvl ?= level-1403eb8: 54002840 b.eq 4043c0 <ferror@plt+0x24e0> // b.noneif (lvl == level-1) {// b.eq 4043c0last ? sym->last_2 : sym->branch_2// b 403ed8}else if (lvl != level-1) {403ebc: f94016a1 ldr x1, [x21, #40] // x21=0x43c870, x1=0x43c898=more403ec0: 91004040 add x0, x2, #0x10 // x0=sym->vert_2403ec4: 8b190021 add x1, x1, x25 // x1=more=more+(0,4,8...) -> more[lvl]403ec8: b9400421 ldr w1, [x1, #4] // more[lvl+1] -> more+4+4403ecc: 7100003f cmp w1, #0x0 // more[lvl+1] ?= 0403ed0: 9a821000 csel x0, x0, x2, ne // if (more[lvl+1]) x2=sym->vert_2; else x2=sym->empty_2403ed4: f940001a ldr x26, [x0]more[lvl + 1] ? sym->vert_2 : sym->empty_2}403ed8: 39400340 ldrb w0, [x26] // if (lvl == level-1), w0=sym->last_2||sym->branch_2; if (lvl != level-1), w0=sym->vert_2||sym->empty_2403edc: 34000080 cbz w0, 403eec <ferror@plt+0x200c>if (w0 != NULL) {403ee0: 97fffd24 bl 403370 <ferror@plt+0x1490> // out_char(char c)403ee4: 38401f40 ldrb w0, [x26, #1]! // w0++403ee8: 35ffffc0 cbnz w0, 403ee0 <ferror@plt+0x2000>out_char();}out_string(lvl == level - 1 ? last ? sym->last_2 : sym->branch_2 : more[lvl + 1] ? sym->vert_2 : sym->empty_2);4043c0: b94063e0 ldr w0, [sp, #96] // w0=last4043c4: 34000060 cbz w0, 4043d0 <ferror@plt+0x24f0>if (last == 0) {// cbz 4043d0x26 = sym->branch_2;}else {4043c8: f9400c5a ldr x26, [x2, #24] // x26=sym+24=sym->last_24043cc: 17fffec3 b 403ed8 <ferror@plt+0x1ff8>x26 = sym->last_2;}4043d0: f940045a ldr x26, [x2, #8] // x26=sym+8=sym->branch_24043d4: 17fffec1 b 403ed8 <ferror@plt+0x1ff8>last ? sym->last_2 : sym->branch_2