We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a10bf6 commit c4309abCopy full SHA for c4309ab
src/optimizer.c
@@ -530,7 +530,12 @@ static char *expr_make_key(const AstExpr *expr)
530
switch (expr->kind)
531
{
532
case EXPR_INT_LITERAL:
533
- snprintf(buffer, sizeof(buffer), "I:%lld", expr->data.int_value);
+ // Include type information in the key to distinguish between int and char literals
534
+ if (expr->type == TYPE_CHAR) {
535
+ snprintf(buffer, sizeof(buffer), "C:%lld", expr->data.int_value);
536
+ } else {
537
+ snprintf(buffer, sizeof(buffer), "I:%lld", expr->data.int_value);
538
+ }
539
return dup_string(buffer);
540
case EXPR_FLOAT_LITERAL:
541
snprintf(buffer, sizeof(buffer), "F:%g", expr->data.float_value);
0 commit comments