aboutsummaryrefslogtreecommitdiff
path: root/include/cps/RuntimeCheck.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cps/RuntimeCheck.h')
-rw-r--r--include/cps/RuntimeCheck.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/cps/RuntimeCheck.h b/include/cps/RuntimeCheck.h
index 5996409..51a07aa 100644
--- a/include/cps/RuntimeCheck.h
+++ b/include/cps/RuntimeCheck.h
@@ -18,6 +18,7 @@ class RuntimeCheck {
llvm::Value *OutOfBoundsMsg;
llvm::Value *EnumRangeMsg;
llvm::Value *NullDerefMsg;
+ llvm::Value *ArrayArgBoundsMsg;
void setupExternalFunctions();
void emitErrorAndExit(llvm::Value *Condition, llvm::Value *Msg, int Line);
@@ -35,6 +36,11 @@ public:
// Dereferencing an unset (null) pointer dies instead of segfaulting.
void emitNullDerefCheck(llvm::Value *Ptr, int Line);
+ // A bounded array parameter is a contract: the argument's runtime bounds
+ // must equal the declared ones.
+ void emitArrayArgBoundsCheck(llvm::Value *ActualLower, llvm::Value *ActualUpper,
+ int64_t DeclaredLower, int64_t DeclaredUpper, int Line);
+
// Runtime-computed variant: FmtArgs are the printf varargs after Msg
// (e.g. {i32 line, ptr filename}). Needed when the failure site is inside
// a synthesized helper function, where the line number is an argument