[bug] "Behavior new new bla" crashes the VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug] "Behavior new new bla" crashes the VM

Holger Hans Peter Freyther-3
Issue status update for
http://smalltalk.gnu.org/node/657
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/657

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  zecke
 Updated by:   zecke
 Status:       active

It is crashing the VM because the object does not even understand
doesNotUnderstand. This means that one should check for either recursion
or if one attempted to send the method.

diff --git a/libgst/interp-bc.inl b/libgst/interp-bc.inl
index 8819481..5085377 100644
--- a/libgst/interp-bc.inl

+++  b/libgst/interp-bc.inl

@@ -201,8 +201,9 @@ _gst_send_message_internal (OOP sendSelector,
      /* :-( cache miss )-: */
      if (!lookup_method (sendSelector, methodData, sendArgs,
method_class))
       {
-         _gst_send_message_internal (_gst_does_not_understand_symbol,
1,
-                                     receiver, method_class);

+          if ( sendSelector != _gst_does_not_understand_symbol)

+                 _gst_send_message_internal
(_gst_does_not_understand_symbol, 1,

+                                              receiver, method_class);

         return;
       }




_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] "Behavior new new bla" crashes the VM

MrGwen
Issue status update for
http://smalltalk.gnu.org/project/issue/657
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/657

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  zecke
 Updated by:   MrGwen
 Status:       active

Instead of changing the vm lookup, why not adding a simple initialize
pattern,
method dictionary (and dnu) is a kind of contract between the image and
the vm.
It is up to you to provide a good behavior (otherwhise the superclass
could
be an integer, or a loop in the between the superclasses, the instance
specification an object,
...).

You could also create a simple BehaviorBuilder:
https://github.com/MrGwen/gst-classbuilder/blob/master/Builder/BehaviorB...
(for instance)



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] "Behavior new new bla" crashes the VM

Paolo Bonzini-3
In reply to this post by Holger Hans Peter Freyther-3
Issue status update for
http://smalltalk.gnu.org/project/issue/657
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/657

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  zecke
 Updated by:   bonzinip
-Status:       active
+Status:       invalid

Gwen is right.  This is not really a bug, though it /is/ indeed a bit
fragile.



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk