mirror of
https://github.com/frida/tinycc
synced 2025-01-03 02:24:24 +03:00
switch: fix label sorting
This commit is contained in:
parent
c2ad11ac70
commit
da63695cf3
8
tccgen.c
8
tccgen.c
@ -4881,8 +4881,12 @@ static void label_or_decl(int l)
|
||||
decl(l);
|
||||
}
|
||||
|
||||
static int case_cmp(const void *a, const void *b)
|
||||
{ return (*(struct case_t**) a)->v1 - (*(struct case_t**) b)->v1; }
|
||||
static int case_cmp(const void *pa, const void *pb)
|
||||
{
|
||||
int a = (*(struct case_t**) pa)->v1;
|
||||
int b = (*(struct case_t**) pb)->v1;
|
||||
return a < b ? -1 : a > b;
|
||||
}
|
||||
|
||||
static void block(int *bsym, int *csym, int is_expr)
|
||||
{
|
||||
|
@ -1554,6 +1554,9 @@ void switch_test()
|
||||
case 3:
|
||||
printf("b");
|
||||
break;
|
||||
case 0xc33c6b9fU:
|
||||
case 0x7c9eeeb9U:
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
Loading…
Reference in New Issue
Block a user