diff options
author | Andy Wingo <wingo@pobox.com> | 2020-07-30 14:34:52 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2020-07-30 14:34:52 +0200 |
commit | aa44a71750aa6b06fd4974330f2c71523a63ecd9 (patch) | |
tree | 988e99d9693a9ae6adc43be24d46cc231568d3ce | |
parent | 2aa05ff3c489472f048501ad5db2a22b193982e1 (diff) | |
parent | 8b37b783ead3a426ac5538d778e2f83e39bc3077 (diff) | |
download | guile-aa44a71750aa6b06fd4974330f2c71523a63ecd9.tar.gz |
Merge https://gitlab.com/wingo/lightening master branch
-rw-r--r-- | libguile/lightening/lightening/lightening.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libguile/lightening/lightening/lightening.c b/libguile/lightening/lightening/lightening.c index 7f42a3496..ad990eb01 100644 --- a/libguile/lightening/lightening/lightening.c +++ b/libguile/lightening/lightening/lightening.c @@ -721,21 +721,26 @@ static void abi_gpr_to_mem(jit_state_t *_jit, enum jit_operand_abi abi, jit_gpr_t base, ptrdiff_t offset, jit_gpr_t src) { + // Invariant: GPR memory destination operand sizes are rounded up to words. + // True for ARM, AArch64, IA32, and X86-64. Some ABIs expect to be able to + // load operands from the stack via a full-word read, so we need to make sure + // we don't leave garbage in the high bytes of (for example) the stack slot + // for a uint8_t arg. switch (abi) { case JIT_OPERAND_ABI_UINT8: case JIT_OPERAND_ABI_INT8: - jit_stxi_c(_jit, offset, base, src); + jit_stxi(_jit, offset, base, src); break; case JIT_OPERAND_ABI_UINT16: case JIT_OPERAND_ABI_INT16: - jit_stxi_s(_jit, offset, base, src); + jit_stxi(_jit, offset, base, src); break; case JIT_OPERAND_ABI_UINT32: case JIT_OPERAND_ABI_INT32: #if __WORDSIZE == 32 case JIT_OPERAND_ABI_POINTER: #endif - jit_stxi_i(_jit, offset, base, src); + jit_stxi(_jit, offset, base, src); break; #if __WORDSIZE == 64 case JIT_OPERAND_ABI_UINT64: |