We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb972a4 commit 6d6d83aCopy full SHA for 6d6d83a
compiler/src/dmd/backend/machobj.d
@@ -1893,8 +1893,18 @@ int MachObj_jmpTableSegment(Symbol* s)
1893
int MachObj_getsegment(const(char)* sectname, const(char)* segname,
1894
int p2align, int flags)
1895
{
1896
- assert(strlen(sectname) <= 16);
1897
- assert(strlen(segname) <= 16);
+ if (strlen(sectname) > 16)
+ {
1898
+ error(Srcpos.init, "invalid section name, length too long for `%s`", sectname);
1899
+ return 0;
1900
+ }
1901
+
1902
+ if (strlen(segname) > 16)
1903
1904
+ error(Srcpos.init, "invalid segment name, length too long for `%s`", segname);
1905
1906
1907
1908
for (int seg = 1; seg < cast(int)SegData.length; seg++)
1909
{ seg_data* pseg = SegData[seg];
1910
if (I64)
0 commit comments