From 8536f7bfd705cc450cb1c7aa0e224efa46ae1b9e Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 29 Jun 2011 09:42:49 +0000 Subject: [PATCH] changes for bounds check --- Robust/src/Runtime/runtime.c | 4 ++-- Robust/src/Runtime/runtime.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index 11cac3e3..01d45555 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -934,9 +934,9 @@ __attribute__((malloc)) StringPtr NewString(const char *str,int length) { /* Generated code calls this if we fail a bounds check */ -void failedboundschk(int num) { + void failedboundschk(int num, int index, struct ArrayObject * ao ) { #ifndef TASK - printf("Array out of bounds\n"); + printf("Array out of bounds at line %u with index %u of object %x with length %u\n", num, index, ao, ao->___length___); #ifdef THREADS threadexit(); #else diff --git a/Robust/src/Runtime/runtime.h b/Robust/src/Runtime/runtime.h index bbde3a1d..ca97ce02 100644 --- a/Robust/src/Runtime/runtime.h +++ b/Robust/src/Runtime/runtime.h @@ -100,7 +100,7 @@ __attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(int index); void initializeexithandler(); -void failedboundschk(int num); +void failedboundschk(int num, int index, struct ArrayObject * ao); void failednullptr(void * stackptr); void abort_task(); void injectinstructionfailure(); -- 2.34.1