Skip to content

Commit

Permalink
Tolerate missing address error
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Sep 9, 2024
1 parent fac91e3 commit bb8b51d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,12 @@ class Objects(using Context @constructorOnly):
def contains(addr: Addr)(using mutable: MutableData): Boolean =
mutable.heap.contains(addr)

def read(addr: Addr)(using mutable: MutableData): Value =
mutable.heap(addr)
def read(addr: Addr)(using mutable: MutableData, trace: Trace, ctx: Context): Value =
if mutable.heap.contains(addr) then
mutable.heap(addr)
else
report.warning("[Internal error] Address not found " + addr + ". Trace:\n" + Trace.show, Trace.position)
Bottom

def writeJoin(addr: Addr, value: Value)(using mutable: MutableData): Unit =
mutable.writeJoin(addr, value)
Expand Down

0 comments on commit bb8b51d

Please sign in to comment.