ObjectFileLoader.st
changeset 1768 ebdb95696790
parent 1765 a6234f291d72
child 1896 227357ec745f
--- a/ObjectFileLoader.st	Thu Jun 22 18:13:48 2006 +0200
+++ b/ObjectFileLoader.st	Thu Jun 22 18:13:51 2006 +0200
@@ -2185,8 +2185,7 @@
 
     |oldDummyMethod who m newHandle
      savedOldClasses savedByteCodeMethods savedMethods
-     functions newFunction
-     saveOldMethodsPerClass anyModulesToInitialize|
+     functions saveOldMethodsPerClass anyModulesToInitialize|
 
     PreviouslyLoadedObjects notNil ifTrue:[
         anyModulesToInitialize := false.
@@ -2381,16 +2380,14 @@
                                 handle moduleID:nil.
                             ] ifFalse:[
                                 ('ObjectFileLoader [info]: reloading ' , fileName , ' ...') infoPrintCR.
-                                functions do:[:oldFunction |
-                                    newFunction := newHandle getFunction:(oldFunction name).
-                                    newFunction isNil ifTrue:[
-                                        ('ObjectFileLoader [info]: function: ''' , oldFunction name , ''' no longer present.') errorPrintCR.
-                                        oldFunction code:nil.
-                                        oldFunction setName:oldFunction name moduleHandle:nil.
+                                functions do:[:eachFunction |  |addr|
+                                    addr := newHandle getFunctionAddress:(eachFunction name) into:eachFunction.
+                                    addr isNil ifTrue:[
+                                        ('ObjectFileLoader [info]: function: ''' , eachFunction name , ''' no longer present.') errorPrintCR.
+                                        eachFunction invalidate.
                                     ] ifFalse:[
-                                        oldFunction code:(newFunction code).
-                                        oldFunction setName:oldFunction name moduleHandle:newHandle.
-                                        ('ObjectFileLoader [info]: rebound function: ''' , oldFunction name , '''.') infoPrintCR.
+                                        eachFunction setModuleHandle:newHandle.
+                                        ('ObjectFileLoader [info]: rebound function: ''' , eachFunction name , '''.') infoPrintCR.
                                     ]
                                 ].
                                 handle becomeSameAs:newHandle.      "/ the old handle is now void
@@ -4124,7 +4121,7 @@
 !ObjectFileLoader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.245 2006-06-22 15:20:57 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.246 2006-06-22 16:13:51 ca Exp $'
 ! !
 
 ObjectFileLoader initialize!