Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions fncompiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,17 @@ func (fn *funcCompiler) popAddr(offset uint64) ast.Expr {
if fn.memory.is64 {
fn.helpers.add("p64")
addr = convert(addr, "p64")
} else if *unsafe || offset != 0 {
// Widen so inlined accesses share a type for bounds-check proofs.
addr = convert(addr, "uint32", "uint64")
} else {
// Keep safe zero-offset addresses uint32.
// Remove this branch once safe helpers inline (#69).
addr = convert(addr, "uint32")
}
if offset == 0 {
return addr
}

if !fn.memory.is64 {
addr = convert(addr, "uint64")
}
return &ast.BinaryExpr{Op: token.ADD, X: addr, Y: uintLit(offset)}
}

Expand Down
2 changes: 1 addition & 1 deletion testdata/regression/shared_export/shared_export.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading