diff options
Diffstat (limited to 'src/wast-parser.y')
-rw-r--r-- | src/wast-parser.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wast-parser.y b/src/wast-parser.y index 2b8a4b0a..9f9879a1 100644 --- a/src/wast-parser.y +++ b/src/wast-parser.y @@ -63,7 +63,10 @@ (Current).filename = YYRHSLOC(Rhs, 1).filename; \ (Current).line = YYRHSLOC(Rhs, 1).line; \ (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ - (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ + if (YYRHSLOC(Rhs, N).line == (Current).line) \ + (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ + else \ + (Current).last_column = YYRHSLOC(Rhs, 1).last_column; \ } else { \ (Current).filename = nullptr; \ (Current).line = YYRHSLOC(Rhs, 0).line; \ |