Always insert the entry EBB before translating any WASM.

The FuncEnvironment callbacks (make_global in particular) may need to
insert code in the entry EBB. We need to make sure the entry EBB has
been inserted in the layout before making those callbacks.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-18 11:53:32 -07:00
parent f5f37ac4a6
commit da4cde8117
2 changed files with 5 additions and 1 deletions

View File

@@ -373,7 +373,7 @@ where
}
/// Make sure that the current EBB is inserted in the layout.
fn ensure_inserted_ebb(&mut self) {
pub fn ensure_inserted_ebb(&mut self) {
let ebb = self.position.ebb;
if self.builder.ebbs[ebb].pristine {
if !self.func.layout.is_ebb_inserted(ebb) {