bin: Fix string reference bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 13 Jan 2022 22:23:38 +0000 (23:23 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 13 Jan 2022 22:23:38 +0000 (23:23 +0100)
coe/bin.py

index de3d6fa..0e92bc6 100644 (file)
@@ -259,10 +259,10 @@ class decoder(object):
                 return self.reftab[idx]
             return self.addref(self.loadint(fp))
         elif pri == T_STR:
                 return self.reftab[idx]
             return self.addref(self.loadint(fp))
         elif pri == T_STR:
-            ret = self.addref(self.loadstr(fp))
+            ret = self.loadstr(fp)
             if sec == STR_SYM:
             if sec == STR_SYM:
-                return data.symbol.get("", ret)
-            return ret
+                return self.addref(data.symbol.get("", ret))
+            return self.addref(ret)
         elif pri == T_BIT:
             ln = self.loadint(fp)
             ret = self.addref(fp.read(ln))
         elif pri == T_BIT:
             ln = self.loadint(fp)
             ret = self.addref(fp.read(ln))