You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix a crash when reporting an error at the end of a file
The compiler crashes with a segmentation fault when an unterminated
C-style comment exists at the very end of a file.
The root cause is a buffer over-read in the error() function, which
attempts to construct a diagnostic message by reading the source line
containing the error. When the error is on the last line of a file
without a trailing newline, this logic would read past the end of the
source buffer.
Fix the issue by adding a bounds check to the loop, ensuring it does
not read beyond the source buffer's size. This allows the compiler to
correctly report the "Unenclosed C-style comment" error instead of
crashing.
0 commit comments