add extra type checks to Compiler::store and Compiler::memory

This commit is contained in:
Joshua Warner
2014-04-30 23:39:44 -06:00
committed by Joshua Warner
parent 1fc6011bf7
commit f9b781149e
2 changed files with 16 additions and 10 deletions

View File

@ -2323,6 +2323,8 @@ class MyCompiler: public Compiler {
Operand* index = 0,
unsigned scale = 1)
{
assert(&c, index != 0 || scale == 1);
assert(&c, type.size() == scale || index == 0);
Value* result = value(&c, type);
appendMemory(&c, static_cast<Value*>(base), displacement,
@ -2600,6 +2602,10 @@ class MyCompiler: public Compiler {
{
assert(&c, srcType.flavor() == static_cast<Value*>(src)->type.flavor());
assert(&c, dstType.flavor() == static_cast<Value*>(dst)->type.flavor());
assert(&c, srcType.flavor() == dstType.flavor());
assert(&c,
srcType.flavor() != ir::Type::Float
|| srcType.size() == static_cast<Value*>(src)->type.size());
appendMove(&c,
lir::Move,
srcType.size(),