Commit 5eb9e062 authored by Russ Cox's avatar Russ Cox

avoid dereferencing nil type on undefined name.

R=ken
DELTA=12  (12 added, 0 deleted, 0 changed)
OCL=15506
CL=15528
parent 6e08991e
...@@ -915,6 +915,8 @@ loop: ...@@ -915,6 +915,8 @@ loop:
case ONOT: case ONOT:
case OANDAND: case OANDAND:
case OOROR: case OOROR:
if(n->left->type == T)
goto ret;
et = n->left->type->etype; et = n->left->type->etype;
if(et != TBOOL) if(et != TBOOL)
goto badt; goto badt;
...@@ -923,6 +925,8 @@ loop: ...@@ -923,6 +925,8 @@ loop:
case OEQ: case OEQ:
case ONE: case ONE:
if(n->left->type == T)
goto ret;
et = n->left->type->etype; et = n->left->type->etype;
if(!okforeq[et]) if(!okforeq[et])
goto badt; goto badt;
...@@ -933,6 +937,8 @@ loop: ...@@ -933,6 +937,8 @@ loop:
case OLE: case OLE:
case OGE: case OGE:
case OGT: case OGT:
if(n->left->type == T)
goto ret;
et = n->left->type->etype; et = n->left->type->etype;
if(!okforadd[et]) if(!okforadd[et])
if(!isptrto(n->left->type, TSTRING)) if(!isptrto(n->left->type, TSTRING))
...@@ -945,12 +951,16 @@ loop: ...@@ -945,12 +951,16 @@ loop:
case OMUL: case OMUL:
case ODIV: case ODIV:
case OPLUS: case OPLUS:
if(n->left->type == T)
goto ret;
et = n->left->type->etype; et = n->left->type->etype;
if(!okforadd[et]) if(!okforadd[et])
goto badt; goto badt;
break; break;
case OMINUS: case OMINUS:
if(n->left->type == T)
goto ret;
et = n->left->type->etype; et = n->left->type->etype;
if(!okforadd[et]) if(!okforadd[et])
goto badt; goto badt;
...@@ -974,6 +984,8 @@ loop: ...@@ -974,6 +984,8 @@ loop:
case OXOR: case OXOR:
case OMOD: case OMOD:
case OCOM: case OCOM:
if(n->left->type == T)
goto ret;
et = n->left->type->etype; et = n->left->type->etype;
if(!okforand[et]) if(!okforand[et])
goto badt; goto badt;
......
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