-
Subzero Win64: fix Call for ptr and spillover args · 01386d17Antonio Maiorano authored
When lowering Call to external functions on x64, Subzero was not correctly allocating 32 bytes for the shadow store. This became apparent when trying to pass pointers to local variables to Call, in which case, the address of the stack variable would be passed via register. However, in the called external function, on x64, it's allowed to use the first 32 bytes on the stack - the shadow store - as scratch space. In my use-case, the called function ended up overwriting the local stack variable that the callee passed a pointer to. Another use-case where this error was apparent was in passing more than four arguments to a Call, in which case, the callee expected the spilled args to be present after the shadow store. This fixes these problems by correctly allocating the 32 byte shadow store when lowering Call on x64. Note that this is similar to e81e8b3c where I fixed the prolog to the generated entry point to take the shadow store into account. Bug: b/144688789 Change-Id: I9d7960bb9c520f5cc3c0ad885305ca5a3c06b5dc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38473Reviewed-by:
Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com>
01386d17
×