help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Fun/Crashes with newer GCC on Debian


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] Fun/Crashes with newer GCC on Debian
Date: Sun, 13 Oct 2013 20:58:38 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Oct 13, 2013 at 03:12:14PM +0200, Paolo Bonzini wrote:
> > the currentClass is nil in this case? So you ask for using
> >  "nil class asMetaclass"
> 
> It should not be nil, it should be UndefinedObject (so you use
> UndefinedObject asMetaclass).

I think there is a difference between DoIt and Eval. During the
begin of the eval the code expects:

   assert (IS_NIL (_gst_current_parser->currentClass));

the DoIt might temporarily set things to the UndefinedObject
and after conditionally calls _gst_reset_compilation_category.


So my current code is this. It is fixing my segfault. When I
set _gst_current_parser->currentClass I would need to reset
it to _gst_nil_oop when executed during the Eval.

comments?


@@ -1947,6 +1949,7 @@ static tree_node
 parse_compile_time_constant (gst_parser *p)
 {
   tree_node temps, statements;
+  OOP currentClass;
   YYLTYPE location = *loc(p,0);
 
   assert (token (p, 0) == '#');
@@ -1959,9 +1962,14 @@ parse_compile_time_constant (gst_parser *p)
   if (!statements || _gst_had_error)
     return _gst_make_oop_constant (&location, _gst_nil_oop);
 
+  currentClass = _gst_current_parser->currentClass;
+  if (IS_NIL(_gst_current_parser->currentClass))
+    currentClass = _gst_undefined_object_class;
+//  _gst_current_parser->currentClass = currentClass;
+
   return _gst_make_method (&location, loc(p, 0),
                            NULL, temps, NULL, statements, NULL,
-                           _gst_current_parser->currentClass,
+                           currentClass,
                            _gst_nil_oop,
                            false);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]