From: bdemsky Date: Wed, 29 Jun 2011 09:42:49 +0000 (+0000) Subject: changes for bounds check X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8536f7bfd705cc450cb1c7aa0e224efa46ae1b9e;p=IRC.git changes for bounds check --- 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();