From 9282c78549d99dca892d6f6fcae79e0a4352c1a6 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 3 May 2014 21:30:31 -0600 Subject: [PATCH] add type asserts in appendReturn and appendCall --- src/codegen/compiler/event.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/codegen/compiler/event.cpp b/src/codegen/compiler/event.cpp index 61d94b436a..8a5e9b8231 100644 --- a/src/codegen/compiler/event.cpp +++ b/src/codegen/compiler/event.cpp @@ -606,6 +606,7 @@ void appendCall(Context* c, unsigned resultSize, util::Slice arguments) { + assert(c, resultSize == result->type.size()); append(c, new (c->zone) CallEvent(c, address, @@ -650,6 +651,7 @@ class ReturnEvent: public Event { }; void appendReturn(Context* c, unsigned size, Value* value) { + assert(c, (value == 0 && size == 0) || size == value->type.size()); append(c, new(c->zone) ReturnEvent(c, size, value)); }