Browse code

Fix types for store/copy instructions.

Török Edvin authored on 2010/05/14 01:51:27
Showing 2 changed files
... ...
@@ -1279,8 +1279,11 @@ static int parseBB(struct cli_bc *bc, unsigned func, unsigned bb, unsigned char
1279 1279
 			break;
1280 1280
 		}
1281 1281
 	}
1282
-	if (inst.opcode == OP_BC_STORE)
1283
-	    inst.type = get_optype(bcfunc, inst.u.binop[0]);
1282
+	if (inst.opcode == OP_BC_STORE) {
1283
+	    int16_t t = get_optype(bcfunc, inst.u.binop[0]);
1284
+	    if (t)
1285
+		inst.type = t;
1286
+	}
1284 1287
 	if (inst.opcode == OP_BC_COPY)
1285 1288
 	    inst.type = get_optype(bcfunc, inst.u.binop[1]);
1286 1289
 	if (!ok) {
... ...
@@ -1179,6 +1179,8 @@ public:
1179 1179
 			    Value *Dest = Values[inst->u.binop[1]];
1180 1180
 			    const PointerType *PTy = cast<PointerType>(Dest->getType());
1181 1181
 			    Op0 = convertOperand(func, PTy->getElementType(), inst->u.binop[0]);
1182
+			    PTy = PointerType::getUnqual(Op0->getType());
1183
+			    Dest = Builder.CreateBitCast(Dest, PTy);
1182 1184
 			    Builder.CreateStore(Op0, Dest);
1183 1185
 			    break;
1184 1186
 			}