From ee7d933ed6a0477426a6f1840bdee034f7cd4810 Mon Sep 17 00:00:00 2001 From: yqco Date: Thu, 11 Aug 2016 04:47:17 -0600 Subject: [PATCH] Add assert for previous I_Error condition --- src/thingdef/thingdef_expression.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 61660ffa8..00c4b1e75 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -3593,6 +3593,7 @@ ExpEmit FxArrayElement::Emit(VMFunctionBuilder *build) if (index->isConstant()) { unsigned indexval = static_cast(index)->GetValue().GetInt(); + assert(indexval < arraytype->ElementCount && "Array index out of bounds"); indexval *= arraytype->ElementSize; if (AddressRequested)