File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -986,10 +986,10 @@ void MCAssembler::layoutSection(MCSection &Sec) {
986986 }
987987 if (!AlignFixup && Size > F.getAlignMaxBytesToEmit ())
988988 Size = 0 ;
989- // Update the variable tail size. The content is ignored.
990- assert (F. VarContentStart == 0 &&
991- " VarContentStart should not be modified " );
992- F.VarContentEnd = Size;
989+ // Update the variable tail size, offset by FixedSize to prevent ubsan
990+ // pointer-overflow in evaluateFixup. The content is ignored.
991+ F. VarContentStart = F. getFixedSize ( );
992+ F.VarContentEnd = F. VarContentStart + Size;
993993 if (F.VarContentEnd > F.getParent ()->ContentStorage .size ())
994994 F.getParent ()->ContentStorage .resize (F.VarContentEnd );
995995 Offset += Size;
You can’t perform that action at this time.
0 commit comments