bytecodealliance / bytecodealliance/wasmtime

Cranelift: leak in remove_constant_phis

Open
#5,451 8 comments 0 reactions 0 assignees View on GitHub
bug cranelift
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

The `remove_constants_phis` replaces the arugments of an instruction without freeing the original list.

https://github.com/bytecodealliance/wasmtime/blob/2cfa024855f4b542999c7bf547838e2f85b244a5/cranelift/codegen/src/remove_constant_phis.rs#L415

One option for fixing this would be to build up the list to replace it as a vector, and then clearing and re-initializing the old arguments list. However, the `remove_constant_phis` pass might not be necessary at all after @jameysharp's refactoring of the SSA builder, so it would be good to investigate whether it's applying at all to start with.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.