Skip to content

Commit

Permalink
fix Issue 21827 - Null pointer exception in elToPair() in backend/cge…
Browse files Browse the repository at this point in the history
…lem.d
  • Loading branch information
WalterBright authored and dlang-bot committed Apr 15, 2021
1 parent 6b6f3a4 commit f13da25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dmd/backend/cgelem.d
Expand Up @@ -5558,7 +5558,7 @@ private elem * optelem(elem *e, goal_t goal)
beg:
//__gshared uint count;
//printf("count: %u\n", ++count);
//{ printf("xoptelem: %p ",e); WROP(e.Eoper); print(" goal x%x\n", goal); }
//{ printf("xoptelem: %p ",e); WROP(e.Eoper); printf(" goal x%x\n", goal); }
assert(e);
elem_debug(e);
assert(e.Ecount == 0); // no CSEs
Expand Down Expand Up @@ -6069,7 +6069,7 @@ elem *doptelem(elem *e, goal_t goal)
if (goal & GOALstruct && e && (tybasic(e.Ety) == TYstruct || tybasic(e.Ety) == TYarray))
e = elstruct(e, goal);

if (topair)
if (topair && e)
e = elToPair(e);

return e;
Expand Down

0 comments on commit f13da25

Please sign in to comment.