Added ADDR_EXPR handling

This commit is contained in:
York Jasper Niebuhr 2025-10-10 17:08:49 +02:00
parent a3ca51a6b5
commit 1b346ed9c0
2 changed files with 2 additions and 1 deletions

View File

@ -117,6 +117,7 @@ static void scan_tree_for_components(tree t, const char *funcname, gimple_stmt_i
case CONVERT_EXPR: case CONVERT_EXPR:
case NOP_EXPR: case NOP_EXPR:
case VIEW_CONVERT_EXPR: case VIEW_CONVERT_EXPR:
case ADDR_EXPR:
scan_tree_for_components(TREE_OPERAND(t,0), funcname, gsi); scan_tree_for_components(TREE_OPERAND(t,0), funcname, gsi);
break; break;
case ARRAY_REF: case ARRAY_REF:

View File

@ -32,7 +32,7 @@ int main(int argc, char** argv) {
b.m2 = 42; b.m2 = 42;
struct B* someB = (struct B*)malloc(sizeof(struct B)); struct B* someB = (struct B*)malloc(sizeof(struct B));
float* someB_m4 = &someB->m4; // This is not recognized yet, simply ends up as "add 0x10" float* someB_m4 = &someB->m4;
container_of(someB_m4, struct B, m4)->m1 = 'x'; container_of(someB_m4, struct B, m4)->m1 = 'x';
return 0; return 0;