runtime: round return value address in runtime.equal

Fixes #3866.

R=rsc, r, nigeltao
CC=golang-dev
https://golang.org/cl/6452046
This commit is contained in:
Shenghou Ma 2012-07-31 23:02:46 -04:00
parent f2b8f6b451
commit e07958f7df
2 changed files with 74 additions and 4 deletions

View file

@ -469,10 +469,11 @@ void
runtime·equal(Type *t, ...)
{
byte *x, *y;
bool *ret;
uintptr ret;
x = (byte*)(&t+1);
y = x + t->size;
ret = (bool*)(y + t->size);
t->alg->equal(ret, t->size, x, y);
y = x + ROUND(t->size, t->align);
ret = (uintptr)(y + t->size);
ret = ROUND(ret, Structrnd);
t->alg->equal((bool*)ret, t->size, x, y);
}