trapmap: delete entry after information is consumed
[mate.git] / Mate / ClassPool.hs
index 8b3e8a961fdb71af97418061fe2f23f8ceeb3041..e476c8b5b92d47b05ff0f2c7a1c0c38b95766915 100644 (file)
@@ -97,6 +97,7 @@ getStaticFieldAddr from = do
   trapmap <- getTrapMap
   let w32_from = fromIntegral from
   let sfi = trapmap M.! w32_from
+  setTrapMap $ M.delete w32_from trapmap
   case sfi of
     (SFI (StaticFieldInfo cls field)) -> getStaticFieldOffset cls field
     _ -> error "getFieldAddr: no trapInfo. abort"
@@ -260,7 +261,7 @@ loadAndInitClass path = do
   -- execute class initializer
   case lookupMethod "<clinit>" (ciFile ci) of
     Just m -> do
-      hmap <- parseMethod (ciFile ci) "<clinit>"
+      hmap <- parseMethod (ciFile ci) "<clinit>" $ MethodSignature [] ReturnsVoid
       case hmap of
         Just hmap' -> do
           let mi = MethodInfo "<clinit>" path (methodSignature m)