Skip to content

Commit

Permalink
Fix bugzilla 24790 - -vcg-ast ICE on lowered assign exp (dlang/dmd!16…
Browse files Browse the repository at this point in the history
…914)

Co-authored-by: Dennis Korpel <[email protected]>
  • Loading branch information
dkorpel and Dennis Korpel authored Oct 3, 2024
1 parent 752c9c6 commit adc9ff1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions dmd/parse.d
Original file line number Diff line number Diff line change
Expand Up @@ -9749,6 +9749,7 @@ immutable PREC[EXP.max + 1] precedence =
EXP.assign : PREC.assign,
EXP.construct : PREC.assign,
EXP.blit : PREC.assign,
EXP.loweredAssignExp : PREC.assign,
EXP.addAssign : PREC.assign,
EXP.minAssign : PREC.assign,
EXP.concatenateAssign : PREC.assign,
Expand Down
5 changes: 5 additions & 0 deletions tests/dmd/compilable/vcg-ast-arraylength.d
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ void main()

static assert(is(typeof(a.length = 0) == size_t));
static assert(is(typeof(a.length = f.length = 0) == size_t));

// https://issues.dlang.org/show_bug.cgi?id=24790
struct S { int[] payload; }
S s;
s.payload.length += 3;
}

0 comments on commit adc9ff1

Please sign in to comment.