forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two fixes for the
-g
(debug info) option (bytecodealliance#6931)
* Fix up a debug info transform bug "Block"s in DWARF are arbitrary-sized constants. They are used for e. g. __int128 constants in C/C++, which is how this was hit. * Add the ".vs" folder to ".gitignore" This is generated by VS when using its "open folder feature". * Monotonize instructon offsets after code emission Turns out that this is easier then fixing them in-place when removing the branch because a bunch of ambient state needs to be passed through to the MachBuffer for that to become possible. Testing: tested to fix the issue on both one of the reported samples as well as my own. * Move the last optimize_branches earlier It is more obviously correct this way that the code which is using buffer.cur_offset() is not reading stale values. * Fix the zero-offset problem with NO_INST_OFFSET Also delete EmitResult::inst_offsets, it was not used. * Add a test * Check both sides of the range for NO_INST_OFFSET If either is unknown, err on the safe side.
- Loading branch information
1 parent
19fb5e1
commit 3742833
Showing
7 changed files
with
177 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ cranelift.dbg* | |
docs/_build | ||
docs/book | ||
.vscode/ | ||
.vs/ | ||
rusty-tags.* | ||
tags | ||
target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
(module | ||
(type (;0;) (func)) | ||
(type (;1;) (func (param i32 i32 i32) (result i32))) | ||
(func (;0;) (type 1) (param i32 i32 i32) (result i32) | ||
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) | ||
i32.const -1 | ||
local.set 6 | ||
local.get 5 | ||
i32.load offset=12 | ||
local.set 8 | ||
local.get 6 | ||
local.set 9 | ||
local.get 8 | ||
local.get 9 | ||
i32.eq | ||
local.set 10 | ||
i32.const 1 | ||
local.set 11 | ||
local.get 10 | ||
local.get 11 | ||
i32.and | ||
local.set 12 | ||
block ;; label = @1 | ||
block ;; label = @2 | ||
local.get 12 | ||
i32.eqz | ||
br_if 0 (;@2;) | ||
i32.const 1 | ||
local.set 13 | ||
local.get 13 | ||
local.set 14 | ||
br 1 (;@1;) | ||
end | ||
local.get 5 | ||
i32.load offset=12 | ||
local.set 15 | ||
local.get 15 | ||
local.set 14 | ||
end | ||
local.get 14 | ||
local.set 16 | ||
local.get 5 | ||
i32.load offset=8 | ||
local.set 17 | ||
local.get 5 | ||
i32.load offset=4 | ||
local.set 18 | ||
local.get 16 | ||
local.get 17 | ||
local.get 18 | ||
call 1 | ||
return) | ||
(func (;1;) (type 1) (param i32 i32 i32) (result i32) | ||
i32.const -1) | ||
(func (;2;) (type 0)) | ||
(table (;0;) 1368 1368 funcref) | ||
(memory (;0;) 800 8000) | ||
(export "memory" (memory 0)) | ||
(export "_start" (func 2))) |