changes for bounds check
authorbdemsky <bdemsky>
Wed, 29 Jun 2011 09:42:49 +0000 (09:42 +0000)
committerbdemsky <bdemsky>
Wed, 29 Jun 2011 09:42:49 +0000 (09:42 +0000)
Robust/src/Runtime/runtime.c
Robust/src/Runtime/runtime.h

index 11cac3e3aa5a4e9fd41dc829a5890e6e1ee262e8..01d4555594a4e9e48564038735b572c3eb59a6dd 100644 (file)
@@ -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
index bbde3a1df0c0124dbd05a4b251ef5b1b0e3bc80c..ca97ce02845b41d00f2cdef4c4aab64127eae5ae 100644 (file)
@@ -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();