Skip to content

Commit

Permalink
Fix #20730 - print SymOff with unsigned offset (#20769)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorpel authored Jan 23, 2025
1 parent 5f47410 commit be6a7bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dmd/hdrgen.d
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@ private void expressionPrettyPrint(Expression e, ref OutBuffer buf, ref HdrGenSt
void visitSymOff(SymOffExp e)
{
if (e.offset)
buf.printf("(& %s%+lld)", e.var.toChars(), e.offset);
buf.printf("(& %s + %llu)", e.var.toChars(), e.offset);
else if (e.var.isTypeInfoDeclaration())
buf.writestring(e.var.toChars());
else
Expand Down
4 changes: 2 additions & 2 deletions compiler/test/fail_compilation/fail13902.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fail_compilation/fail13902.d(33): Error: returning `&s1.v` escapes a reference t
fail_compilation/fail13902.d(38): Error: returning `& sa1` escapes a reference to local variable `sa1`
fail_compilation/fail13902.d(39): Error: returning `& sa2` escapes a reference to local variable `sa2`
fail_compilation/fail13902.d(40): Error: returning `& x` escapes a reference to local variable `x`
fail_compilation/fail13902.d(41): Error: returning `(& x+4)` escapes a reference to local variable `x`
fail_compilation/fail13902.d(41): Error: returning `(& x + 4)` escapes a reference to local variable `x`
fail_compilation/fail13902.d(42): Error: returning `& x + cast(long)x * 4L` escapes a reference to local variable `x`
fail_compilation/fail13902.d(45): Error: returning `& y` escapes a reference to local variable `y`
---
Expand Down Expand Up @@ -59,7 +59,7 @@ fail_compilation/fail13902.d(76): Error: returning `&s1.v` escapes a reference t
fail_compilation/fail13902.d(81): Error: returning `& sa1` escapes a reference to parameter `sa1`
fail_compilation/fail13902.d(82): Error: returning `& sa2` escapes a reference to parameter `sa2`
fail_compilation/fail13902.d(83): Error: returning `& x` escapes a reference to parameter `x`
fail_compilation/fail13902.d(84): Error: returning `(& x+4)` escapes a reference to parameter `x`
fail_compilation/fail13902.d(84): Error: returning `(& x + 4)` escapes a reference to parameter `x`
fail_compilation/fail13902.d(85): Error: returning `& x + cast(long)x * 4L` escapes a reference to parameter `x`
fail_compilation/fail13902.d(88): Error: returning `& y` escapes a reference to parameter `y`
---
Expand Down

0 comments on commit be6a7bb

Please sign in to comment.