Found with GODEBUG=wbshadow=2 mode.
Eventually that will run automatically, but right now
it still detects other missing write barriers.
Change-Id: I1320d5340a9e421c779f24f3b170e33974e56e4f
Reviewed-on: https://go-review.googlesource.com/2278
Reviewed-by: Rick Hudson <rlh@golang.org>
case OIND:
case ODOTPTR:
case OCLOSUREVAR:
+ case OPARAM:
return 1;
case ODOT:
return islvalue(n->left);
case ONONAME:
case OINDREG:
case OEMPTY:
+ case OPARAM:
goto ret;
case ONOT:
{
Type *t;
Iter savet;
- Node *v;
+ Node *v, *as;
NodeList *nn;
nn = nil;
if(v->alloc == nil)
v->alloc = callnew(v->type);
nn = list(nn, nod(OAS, v->heapaddr, v->alloc));
- if((v->class & ~PHEAP) != PPARAMOUT)
- nn = list(nn, nod(OAS, v, v->stackparam));
+ if((v->class & ~PHEAP) != PPARAMOUT) {
+ as = nod(OAS, v, v->stackparam);
+ v->stackparam->typecheck = 1;
+ typecheck(&as, Etop);
+ as = applywritebarrier(as, &nn);
+ nn = list(nn, as);
+ }
}
return nn;
}