Skip to content

Commit f8cf2c4

Browse files
committed
fix: make format && make check
1 parent 72f41fd commit f8cf2c4

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

kmir/src/kmir/alloc.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
from .ty import Ty
99

1010
if TYPE_CHECKING:
11-
from typing import Any, Final
12-
13-
14-
_LOGGER: Final = logging.getLogger(__name__)
11+
# No conditional typing-only imports needed currently
12+
pass
1513

1614

1715
AllocId = NewType('AllocId', int)
@@ -46,7 +44,7 @@ def from_dict(dct: dict[str, Any]) -> GlobalAlloc:
4644
return Static.from_dict(dct)
4745
case {'Memory': _}:
4846
return Memory.from_dict(dct)
49-
case {'Static': alloc_id}:
47+
case {'Static': _}:
5048
return Static.from_dict(dct)
5149
case {'Function': _}:
5250
return Function.from_dict(dct)

kmir/src/kmir/decoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pyk.kast.inner import KApply
77
from pyk.kast.prelude.string import stringToken
88

9-
from .alloc import Allocation, AllocInfo, Memory, ProvenanceEntry, ProvenanceMap, Static, Function, VTable
9+
from .alloc import Allocation, AllocInfo, Function, Memory, ProvenanceEntry, ProvenanceMap, Static, VTable
1010
from .ty import (
1111
ArbitraryFields,
1212
ArrayT,

kmir/src/kmir/linker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ def apply_offset(info: SMIRInfo, offset: int) -> None:
210210
apply_offset_provenance(allocation['provenance'], offset)
211211
case {'Static': alloc_id}: # global_alloc: Static
212212
alloc['global_alloc']['Static'] = alloc_id + offset
213-
case {'Function': _instance}: # global_alloc: Function
213+
case {'Function': _}: # global_alloc: Function
214214
# Quick-compat: leave function instance as-is; not used for offset computations
215215
pass
216-
case {'VTable': _vtable}: # global_alloc: VTable
216+
case {'VTable': _}: # global_alloc: VTable
217217
# Quick-compat: keep as-is (if present). We do not offset embedded types here.
218218
pass
219219
case _:
@@ -258,6 +258,7 @@ def apply_offset_item(item: dict, offset: int) -> None:
258258
if 'MonoItemFn' in item and 'body' in item['MonoItemFn']:
259259
body = item['MonoItemFn']['body']
260260
if body is None:
261+
_LOGGER.warning(f"MonoItemFn {item['MonoItemFn'].get('name', '<unknown>')!r} has no body; skipping offsets")
261262
return
262263
for local in body.get('locals', []):
263264
local['ty'] += offset

0 commit comments

Comments
 (0)