Check whether the declaration is not NULL before issuing a warning about using a...
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Aug 2008 12:40:02 +0000 (12:40 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Aug 2008 12:40:02 +0000 (12:40 +0000)
[r21277]

ast2firm.c

index 7261ac8..ff134d8 100644 (file)
@@ -96,9 +96,11 @@ ir_node *uninitialized_local_var(ir_graph *irg, ir_mode *mode, int pos)
 {
        const declaration_t *declaration = get_irg_loc_description(irg, pos);
 
-       warningf(&declaration->source_position,
-                "variable '%#T' might be used uninitialized",
-                declaration->type, declaration->symbol);
+       if (declaration != NULL) {
+               warningf(&declaration->source_position,
+                        "variable '%#T' might be used uninitialized",
+                        declaration->type, declaration->symbol);
+       }
        return new_r_Unknown(irg, mode);
 }