Better validation that values aren't moving between blocks.

This commit is contained in:
Ben Vanik
2014-08-06 09:00:59 -07:00
parent ff59f23de0
commit 19274ef26d
3 changed files with 16 additions and 2 deletions

View File

@@ -72,6 +72,15 @@ int ValidationPass::ValidateInstruction(Block* block, Instr* instr) {
return 1;
}
if (instr->dest) {
assert_true(instr->dest->def == instr);
auto use = instr->dest->use_head;
while (use) {
assert_true(use->instr->block == block);
use = use->next;
}
}
uint32_t signature = instr->opcode->signature;
if (GET_OPCODE_SIG_TYPE_SRC1(signature) == OPCODE_SIG_TYPE_V) {
if (ValidateValue(block, instr, instr->src1.value)) {