Skip to content

Commit

Permalink
Fix issue #362.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnmakarov committed Aug 8, 2023
1 parent 69465b2 commit 61b7add
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions c-tests/new/issue362.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
n () {
char* p;
int m = {};
}
1 change: 1 addition & 0 deletions c-tests/new/issue362.c.expectrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
5 changes: 4 additions & 1 deletion c2mir/c2mir.c
Original file line number Diff line number Diff line change
Expand Up @@ -7578,7 +7578,10 @@ static void check_initializer (c2m_ctx_t c2m_ctx, decl_t member_decl, struct typ
}
return;
}
if (init == NULL) return;
if (init == NULL) {
if (scalar_type_p (type)) error (c2m_ctx, POS (initializer), "empty scalar initializer");
return;
}
assert (init->code == N_INIT);
des_list = NL_HEAD (init->u.ops);
assert (des_list->code == N_LIST);
Expand Down

0 comments on commit 61b7add

Please sign in to comment.