summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-12-05 13:09:19 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-12-05 13:09:19 +0000
commit99e068a0ddcdc6943ab7ebe75b265e1a7929f8e5 (patch)
tree951087e883a318235d1c6c0f55df6476d174569d
parent64a21f9cefbb237df039e29135849079c8398427 (diff)
Modif traitement des acces hors bornes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@509 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testasmcomp/alpha.asm15
-rw-r--r--testasmcomp/main.c6
-rw-r--r--testasmcomp/mainarith.c6
3 files changed, 27 insertions, 0 deletions
diff --git a/testasmcomp/alpha.asm b/testasmcomp/alpha.asm
index 9f7992a6c..2bb1a2686 100644
--- a/testasmcomp/alpha.asm
+++ b/testasmcomp/alpha.asm
@@ -58,3 +58,18 @@ caml_c_call:
ret ($26)
.end caml_c_call
+
+/* Glue code to jump to array_bound_error after reinitializing $gp */
+
+ .globl call_array_bound_error
+ .ent call_array_bound_error
+ .align 3
+call_array_bound_error:
+ /* Rebuild $gp */
+ br $27, $106
+$106: ldgp $gp, 0($27)
+ /* Branch to array_bound_error -- never returns */
+ jsr array_bound_error
+
+ .end call_array_bound_error
+
diff --git a/testasmcomp/main.c b/testasmcomp/main.c
index feeea9ff4..8a83bdacc 100644
--- a/testasmcomp/main.c
+++ b/testasmcomp/main.c
@@ -13,6 +13,12 @@
#include <stdio.h>
+void array_bound_error()
+{
+ fprintf(stderr, "Fatal error: out-of-bound access in array or string\n");
+ exit(2);
+}
+
#ifdef SORT
long cmpint(i, j)
diff --git a/testasmcomp/mainarith.c b/testasmcomp/mainarith.c
index f53f2d967..9262acc52 100644
--- a/testasmcomp/mainarith.c
+++ b/testasmcomp/mainarith.c
@@ -13,6 +13,12 @@
#include <stdio.h>
+void array_bound_error()
+{
+ fprintf(stderr, "Fatal error: out-of-bound access in array or string\n");
+ exit(2);
+}
+
long r[100];
double d[10];
long x, y;