[stable] Fix Issue 24144 - [REG2.105] Silent file name index overflow#15604
[stable] Fix Issue 24144 - [REG2.105] Silent file name index overflow#15604RazvanN7 merged 1 commit intodlang:stablefrom
Conversation
|
Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + dmd#15604" |
* Print an ICE message for Loc.filename overflows * Increase the Loc size again, raising the file name limit from 64K to 4G but keeping the index indirection from dlang#15199. The `Loc` size for DMD-as-a-library is 16 bytes then, and 12 bytes otherwise.
| char structliteralexp[76LLU]; | ||
| char compoundliteralexp[40LLU]; | ||
| char nullexp[25LLU]; | ||
| char nullexp[29LLU]; |
There was a problem hiding this comment.
Not too bad, eh? Seems like the size of 12 and alignment of 4 does pay off vs. the previous 16-bytes size.
dkorpel
left a comment
There was a problem hiding this comment.
Should eventually be reduced to 4 bytes anyway
Struct Loc? It shouldn't matter what size it is. Nodes should only have a reference to a unique location to keep their size down. |
|
How about just keeping an index into the concatenation of all source files? The source file and file location can be recovered using binary search on a prefix sum of file sizes. |
|
The function adjustLocForMixin in dsymbolsem.d is the party guilty of generating lots of filenames. |
Loc.filenameoverflowsLocsize again, raising the file name limit from 64K to 4G but keeping the index indirection from reduce Loc.sizeof by 8 bytes #15199. TheLocsize for DMD-as-a-library is 16 bytes then, and 12 bytes otherwise.