Commit 3a2da76
committed
Fix RISC-V stage2 compilation buffer overflow
The RISC-V target was experiencing segmentation faults during stage2
compilation when stdin was redirected. The root cause was insufficient
buffer size for the SOURCE buffer when compiling large programs like
shecc itself.
The total size of all included source files for RISC-V was approaching
the 512KB limit (MAX_SOURCE), and with stdin redirection adding
overhead, this caused buffer overflow and segmentation faults.
Increased MAX_SOURCE from 524288 (512KB) to 1048576 (1MB) to provide
adequate buffer space for self-hosting compilation on all architectures.1 parent 4d0b963 commit 3a2da76
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments