Permalink
Browse files

when compiling write barriers, don't assert that the slot must be in …

…the auto-zone, because it could potentially be used on locals from bindings originally situated on the stack

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@4543 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 2692d6e commit 29e274fcfff7c4b7095c20160605419c4b9566cb @lrz lrz committed Sep 27, 2010
Showing with 7 additions and 3 deletions.
  1. +6 −2 include/ruby/macruby.h
  2. +1 −1 kernel.c
View
@@ -37,19 +37,23 @@ extern void *__auto_zone;
extern auto_zone_t *__auto_zone;
#endif
-#define GC_WB(dst, newval) \
+#define GC_WB_0(dst, newval, check) \
do { \
void *nv = (void *)newval; \
if (!SPECIAL_CONST_P(nv)) { \
if (!auto_zone_set_write_barrier(__auto_zone, \
(const void *)dst, (const void *)nv)) { \
- rb_bug("destination %p isn't in the auto zone", dst); \
+ if (check) { \
+ rb_bug("destination %p isn't in the auto zone", dst); \
+ } \
} \
} \
*(void **)dst = nv; \
} \
while (0)
+#define GC_WB(dst, newval) GC_WB_0(dst, newval, true)
+
static inline void *
rb_objc_retain(void *addr)
{
View
@@ -27,7 +27,7 @@
PRIMITIVE VALUE
vm_gc_wb(VALUE *slot, VALUE val)
{
- GC_WB(slot, val);
+ GC_WB_0(slot, val, false);
return val;
}

0 comments on commit 29e274f

Please sign in to comment.