Commit 900e076d authored by Russ Cox's avatar Russ Cox

handle zeroed interface in ifaceI2I

R=r
OCL=16938
CL=16938
parent 32d00e6c
...@@ -231,7 +231,6 @@ sys·ifaceI2T(Sigt *st, Map *im, void *it, void *ret) ...@@ -231,7 +231,6 @@ sys·ifaceI2T(Sigt *st, Map *im, void *it, void *ret)
void void
sys·ifaceI2I(Sigi *si, Map *im, void *it, Map *retim, void *retit) sys·ifaceI2I(Sigi *si, Map *im, void *it, Map *retim, void *retit)
{ {
if(debug) { if(debug) {
prints("I2I sigi="); prints("I2I sigi=");
printsigi(si); printsigi(si);
...@@ -241,15 +240,17 @@ sys·ifaceI2I(Sigi *si, Map *im, void *it, Map *retim, void *retit) ...@@ -241,15 +240,17 @@ sys·ifaceI2I(Sigi *si, Map *im, void *it, Map *retim, void *retit)
} }
if(im == nil) { if(im == nil) {
throw("ifaceI2I: nil map"); // If incoming interface is uninitialized (zeroed)
return; // make the outgoing interface zeroed as well.
retim = nil;
retit = nil;
} else {
retit = it;
retim = im;
if(im->sigi != si)
retim = hashmap(si, im->sigt);
} }
retit = it;
retim = im;
if(im->sigi != si)
retim = hashmap(si, im->sigt);
if(debug) { if(debug) {
prints("I2I ret="); prints("I2I ret=");
printiface(retim, retit); printiface(retim, retit);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment