Nobuyoshi Nakada
5/25/2007 1:23:00 PM
Hi,
At Fri, 25 May 2007 21:43:54 +0900,
Ollivier Robert wrote in [ruby-talk:252956]:
> It fails during compilation with the following message:
>
> ...
> gcc -O -pipe -pipe -fno-common -L. main.o libruby-static.a
> -lpthread -ldl -lobjc -o miniruby
> : -- stack frame ------------
> 0000 (0x126000): 00000000 <- lfp <- dfp
> -- control frame ----------
> c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------
> ---------------------------
> [BUG] Bus Error
> ruby 1.9.0 (2007-05-25) [powerpc-darwin8.9.0]
What command failed?
> Running miniruby and pressing ^D leads to the same message. miniruby -v,
> same.
It's a known bug.
Index: compile.c
===================================================================
--- compile.c (revision 12384)
+++ compile.c (working copy)
@@ -145,5 +145,8 @@ rb_iseq_compile(VALUE self, NODE *node)
GetISeqPtr(self, iseq);
- if (nd_type(node) == NODE_SCOPE) {
+ if (node == 0) {
+ COMPILE(ret, "nil", node);
+ }
+ else if (nd_type(node) == NODE_SCOPE) {
/* iseq type of top, method, class, block */
set_local_table(iseq, node->nd_tbl);
@@ -198,7 +201,4 @@ rb_iseq_compile(VALUE self, NODE *node)
COMPILE(ret, "defined guard", node);
}
- else if (node == 0) {
- COMPILE(ret, "nil", node);
- }
else {
rb_bug("unknown scope");
--
Nobu Nakada