Commit a91a0a6a authored by Ken Thompson's avatar Ken Thompson

array compare (except = != nil) are illegal

R=r
OCL=21637
CL=21637
parent 6fa74e09
......@@ -751,6 +751,11 @@ bgen(Node *n, int true, Prog *to)
}
if(isdarray(nl->type)) {
// only valid to cmp darray to literal nil
if((a != OEQ && a != ONE) || nr->op != OLITERAL) {
yyerror("illegal array comparison");
break;
}
a = optoas(a, types[tptr]);
regalloc(&n1, types[tptr], N);
agen(nl, &n1);
......
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