mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
Michael found a bug where some copies
from registers to memory in the arm64
abi clobber the stack. The test case
is:
type :T = { w }
function w $f() {
@start
%p =:T call $g()
%x =w loadw %p
ret %x
}
qbe will write 4 bytes out of bounds
when pulling the result struct from
its register. The same bug can be
observed if :T's definition is {w 3};
in this case qbe writes 16 bytes in
a slot of 12 bytes.
This patch changes stkblob() to use
the rounded argument size if it is
going to be restored from registers.
Relatedly, mem->reg loads for structs
with size < 16 and != 8, are treated
a bit sloppily both in the arm64 and
in the sysv abis. That is much less
harmful than the present bug.
|
||
|---|---|---|
| amd64 | ||
| arm64 | ||
| doc | ||
| minic | ||
| test | ||
| tools | ||
| .gitignore | ||
| .tag | ||
| alias.c | ||
| all.h | ||
| cfg.c | ||
| copy.c | ||
| fold.c | ||
| gas.c | ||
| LICENSE | ||
| live.c | ||
| load.c | ||
| main.c | ||
| Makefile | ||
| mem.c | ||
| ops.h | ||
| parse.c | ||
| README | ||
| rega.c | ||
| spill.c | ||
| ssa.c | ||
| util.c | ||
QBE - Backend Compiler http://c9x.me/compile/ doc/ Documentation. minic/ An example C frontend for QBE. tools/ Miscellaneous tools (testing). test/ Tests. amd64/ arm64/ Architecture-specific code. The LICENSE file applies to all files distributed. - Compilation Invoke GNU make in this directory to create the executable file obj/qbe. On some systems (BSD) you might have to use 'gmake' instead of 'make'.