[clang][CodeGen] Fix size calculation in vbptr split memory region in EmitNullBaseClassInitialization (#184558)
When splitting memory stores around multiple virtual base pointers
(vbptrs)
in the Microsoft ABI, the calculation for the size of the memory region
after
each vbptr was incorrect.
The bug/old calculation: SplitAfterSize = LastStoreSize -
SplitAfterOffset
This subtracts an absolute offset from a relative size, causing
incorrect (too small) sizes after the second vbptr.
The correct size should be:
SplitAfterSize = (LastStoreOffset + LastStoreSize) - SplitAfterOffset
Since all store regions extend to the end of the non-virtual portion
(NVSize),
this patch uses the simplified form:
SplitAfterSize = NVSize - SplitAfterOffset
The bug causes the assertion failure: "negative store size!"
Fixes https://github.com/llvm/llvm-project/issues/42101