don't access void* out of alignment in refc GC to avoid UB (#21560)

This commit is contained in:
tersec
2023-03-22 22:05:20 +01:00
committed by GitHub
parent d84b02f0e0
commit e8a70ff179

View File

@@ -391,7 +391,6 @@ else:
let regEnd = sp +% sizeof(registers)
while sp <% regEnd:
gcMark(gch, cast[PPointer](sp)[])
gcMark(gch, cast[PPointer](sp +% sizeof(pointer) div 2)[])
sp = sp +% sizeof(pointer)
# Make sure sp is word-aligned
sp = sp and not (sizeof(pointer) - 1)