dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 510 forks source link

Wasm: RhpNewArrayAlign8 use non-padded size when going to the slow path #8324

Closed yowl closed 4 years ago

yowl commented 4 years ago

This PR fixes a bug when allocating arrays that required 8 byte alignment, if the slow path was chosen the padded size, i.e. with the extra 12 byte object, was being passed to RhpGcAlloc (and RhpPublishObject). This change passes the size of the actual new array without the padding.

Fixes #8317

yowl commented 4 years ago

Think I may have the same bug in the other places where g_pFreeObjectEEType is used.

yowl commented 4 years ago

I've changed the other places where this occurs. I'm not convinced this is the whole story, firstly because I'm still seeing objects aligned at the 2 byte boundary when the GC runs which should be possible, right? Also I can't get any class to go through RhpNewFastAlign8.