[Commit] nickle ChangeLog,1.24,1.25 box.c,1.20,1.21
Keith Packard
commit at keithp.com
Sat Apr 10 23:20:36 PDT 2004
- Previous message: [Commit] nickle ChangeLog, 1.23, 1.24 array.c, 1.22,
1.23 builtin-toplevel.c, 1.20, 1.21 builtin.c, 1.16,
1.17 compile.c, 1.146, 1.147 execute.c, 1.87, 1.88 file.c,
1.59, 1.60 gram.y, 1.128, 1.129 hash.c, 1.4, 1.5 lex.l, 1.70,
1.71 main.c, 1.35, 1.36 nickle.h, 1.113, 1.114 pretty.c, 1.65,
1.66 type.c, 1.60, 1.61 value.h, 1.99, 1.100
- Next message: [Commit] nickle ChangeLog,1.25,1.26 builtin-toplevel.c,1.21,1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: keithp
Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv12739
Modified Files:
ChangeLog box.c
Log Message:
2004-04-10 Keith Packard <keithp at keithp.com>
* box.c: (BoxRewrite):
Ugh. Array shrink causes problems with references to
elements now outside the box boundaries. "real" fix
is hard, so here's a kludge to keep the interpreter
from crashing and (perhaps) prevent the error
from propagating through the application.
Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- a/ChangeLog 11 Apr 2004 06:06:51 -0000 1.24
+++ b/ChangeLog 11 Apr 2004 06:20:34 -0000 1.25
@@ -1,5 +1,14 @@
2004-04-10 Keith Packard <keithp at keithp.com>
+ * box.c: (BoxRewrite):
+ Ugh. Array shrink causes problems with references to
+ elements now outside the box boundaries. "real" fix
+ is hard, so here's a kludge to keep the interpreter
+ from crashing and (perhaps) prevent the error
+ from propagating through the application.
+
+2004-04-10 Keith Packard <keithp at keithp.com>
+
* array.c: (ArrayPrint), (ArrayResize):
* builtin-toplevel.c: (do_setdims), (do_setdim):
* builtin.c: (BuiltinType):
Index: box.c
===================================================================
RCS file: /local/src/CVS/nickle/box.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- a/box.c 27 Feb 2004 03:50:15 -0000 1.20
+++ b/box.c 11 Apr 2004 06:20:34 -0000 1.21
@@ -116,6 +116,23 @@
e = chunk * r->newstride + off;
box = r->new;
}
+ /*
+ * XXX oops. References to previously available storage
+ * should do something sensible instead of cratering.
+ * The desired semantic is for them to persist, pointing
+ * to whatever storage was there before the underlying object
+ * was resized. But, that's "hard". This check will
+ * at least prevent a seg fault.
+ */
+ if (e >= box->nvalues)
+ {
+ RaiseStandardException (exception_invalid_array_bounds,
+ "Rewriting reference beyond box bounds",
+ 1, NewInt (e));
+ e = 0;
+ box = NewBox (True, False, 1, typePrim[rep_void]);
+ BoxValueSet (box, 0, 0);
+ }
*ep = e;
return box;
}
- Previous message: [Commit] nickle ChangeLog, 1.23, 1.24 array.c, 1.22,
1.23 builtin-toplevel.c, 1.20, 1.21 builtin.c, 1.16,
1.17 compile.c, 1.146, 1.147 execute.c, 1.87, 1.88 file.c,
1.59, 1.60 gram.y, 1.128, 1.129 hash.c, 1.4, 1.5 lex.l, 1.70,
1.71 main.c, 1.35, 1.36 nickle.h, 1.113, 1.114 pretty.c, 1.65,
1.66 type.c, 1.60, 1.61 value.h, 1.99, 1.100
- Next message: [Commit] nickle ChangeLog,1.25,1.26 builtin-toplevel.c,1.21,1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list