mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
fix amd64 addressing selection bug (afl)
Reported by Alessandro Mantovani.
Unlikely to be hit in practice
because we don't add addresses to
addresses.
type :biggie = { l, l, l }
function $repro(:biggie %p) {
@start
%x =l add %p, $a
storew 42, %x
ret
}
This commit is contained in:
parent
6d9ee13895
commit
7f4ab8d801
@ -184,6 +184,7 @@ regtoa(int reg, int sz)
|
||||
{
|
||||
static char buf[6];
|
||||
|
||||
assert(reg <= XMM15);
|
||||
if (reg >= XMM0) {
|
||||
sprintf(buf, "xmm%d", reg-XMM0);
|
||||
return buf;
|
||||
|
||||
@ -147,7 +147,7 @@ seladdr(Ref *r, ANum *an, Fn *fn)
|
||||
* rewrite it or bail out if
|
||||
* impossible
|
||||
*/
|
||||
if (!req(a.index, R))
|
||||
if (!req(a.index, R) || rtype(a.base) != RTmp)
|
||||
return;
|
||||
else {
|
||||
a.index = a.base;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user