ExecutableFunction.st
changeset 107 f3e3e2dad7fd
parent 92 0c73b48551ac
child 131 39599c151f30
--- a/ExecutableFunction.st	Thu Aug 11 23:35:47 1994 +0200
+++ b/ExecutableFunction.st	Thu Aug 11 23:36:14 1994 +0200
@@ -12,7 +12,7 @@
 
 Object subclass:#ExecutableFunction
        instanceVariableNames:'code* flags'
-       classVariableNames:''
+       classVariableNames:'InvalidCodeSignal'
        poolDictionaries:''
        category:'Kernel-Methods'
 !
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1994 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.3 1994-08-05 00:54:34 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.4 1994-08-11 21:36:14 claus Exp $
 '!
 
 !ExecutableFunction class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.3 1994-08-05 00:54:34 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.4 1994-08-11 21:36:14 claus Exp $
 "
 !
 
@@ -55,6 +55,7 @@
 
     code        <not_an_object>   the function pointer to the machine code.
 				  Not accessable from smalltalk code.
+
     flags       <SmallInteger>    special flag bits coded in a number
 
     NOTICE: layout known by runtime system and compiler - do not change
@@ -69,6 +70,15 @@
     ^ true
 ! !
 
+!ExecutableFunction class methodsFor:'initialization'!
+
+initialize
+    InvalidCodeSignal isNil ifTrue:[
+        InvalidCodeSignal := (Signal new) mayProceed:true.
+        InvalidCodeSignal notifierString:'invalid code-object - not executable'.
+    ]
+! !
+
 !ExecutableFunction methodsFor:'accessing'!
 
 instVarAt:index
@@ -139,12 +149,13 @@
 
 invalidCode
     "this error is triggered by the interpreter when something is wrong
-     with the code object (any error not handled below).
+     with the code object (any error not handled by Method-signals).
      In this case, the VM sends this to the bad method/block (the receiver).
      Can only happen when the Compiler/runtime system is broken or
      someone played around."
 
-    self error:'invalid code-object - not executable'
+    InvalidCodeSignal raise.
+    ^ nil
 ! !
 
 !ExecutableFunction methodsFor:'binary storage'!