From 3029bb2d7ee9264efafea1accc0ff80715dd0bad Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 3 May 2014 20:02:29 -0600 Subject: [PATCH] add type asserts in Compiler::truncate --- src/codegen/compiler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/codegen/compiler.cpp b/src/codegen/compiler.cpp index 1a17e9f9cd..dc9c6dd79e 100644 --- a/src/codegen/compiler.cpp +++ b/src/codegen/compiler.cpp @@ -2562,6 +2562,10 @@ class MyCompiler: public Compiler { virtual ir::Value* truncate(ir::Type type, ir::Type srcType, ir::Value* src) { + assert(&c, srcType == src->type); + assert(&c, src->type.flavor() == type.flavor()); + assert(&c, type.flavor() != ir::Type::Float); + assert(&c, type.size() < src->type.size()); Value* dst = value(&c, type); appendMove(&c, lir::Move,