Fixing badness in release mode.

This commit is contained in:
Ben Vanik 2014-01-14 18:28:25 -08:00
parent ea9df58ce8
commit 9a09c2072e
3 changed files with 5 additions and 3 deletions

View File

@ -402,6 +402,7 @@ Instr* HIRBuilder::AppendInstr(
instr->opcode = &opcode_info; instr->opcode = &opcode_info;
instr->flags = flags; instr->flags = flags;
instr->dest = dest; instr->dest = dest;
instr->src1.value = instr->src2.value = instr->src3.value = NULL;
instr->src1_use = instr->src2_use = instr->src3_use = NULL; instr->src1_use = instr->src2_use = instr->src3_use = NULL;
if (dest) { if (dest) {
dest->def = instr; dest->def = instr;

View File

@ -52,19 +52,19 @@ void Instr::Replace(const OpcodeInfo* opcode, uint16_t flags) {
this->opcode = opcode; this->opcode = opcode;
this->flags = flags; this->flags = flags;
if (dest) {
dest->def = NULL;
}
if (src1_use) { if (src1_use) {
src1.value->RemoveUse(src1_use); src1.value->RemoveUse(src1_use);
src1.value = NULL;
src1_use = NULL; src1_use = NULL;
} }
if (src2_use) { if (src2_use) {
src2.value->RemoveUse(src2_use); src2.value->RemoveUse(src2_use);
src2.value = NULL;
src2_use = NULL; src2_use = NULL;
} }
if (src3_use) { if (src3_use) {
src3.value->RemoveUse(src3_use); src3.value->RemoveUse(src3_use);
src3.value = NULL;
src3_use = NULL; src3_use = NULL;
} }
} }

View File

@ -59,6 +59,7 @@ public:
TypeName type; TypeName type;
uint32_t flags; uint32_t flags;
uint32_t reserved;
ConstantValue constant; ConstantValue constant;
Instr* def; Instr* def;