half of bug193

R=ken
OCL=33730
CL=33730
diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c
index fba107f..8c76ebb 100644
--- a/src/cmd/gc/typecheck.c
+++ b/src/cmd/gc/typecheck.c
@@ -335,6 +335,11 @@
 			yyerror("invalid operation: %#N (shift count type %T)", n, r->type);
 			goto error;
 		}
+		t = l->type;
+		if(t != T && t->etype != TIDEAL && !isint[t->etype]) {
+			yyerror("invalid operation: %#N (shift of type %T)", n, t);
+			goto error;
+		}
 		// no defaultlit for left
 		// the outer context gives the type
 		n->type = l->type;