Update gen wasm

This commit is contained in:
Ayaz Hafiz 2023-01-04 13:01:31 -06:00
parent c3e2e7aade
commit ee7e9d4ab5
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 5 additions and 6 deletions

View file

@ -7,9 +7,8 @@ The user needs to analyse the Wasm module's memory to decode the result.
use bumpalo::{collections::Vec, Bump};
use roc_builtins::bitcode::{FloatWidth, IntWidth};
use roc_mono::layout::{Builtin, Layout, LayoutInterner, UnionLayout};
use roc_mono::layout::{Builtin, InLayout, Layout, LayoutInterner, UnionLayout};
use roc_std::{RocDec, RocList, RocOrder, RocResult, RocStr, I128, U128};
use roc_target::TargetInfo;
use roc_wasm_module::{
linking::SymInfo, linking::WasmObjectSymbol, Align, Export, ExportType, LocalId, Signature,
ValueType, WasmModule,
@ -42,10 +41,10 @@ pub fn insert_wrapper_for_layout<'a>(
module: &mut WasmModule<'a>,
wrapper_name: &'static str,
main_fn_index: u32,
layout: &Layout<'a>,
layout: InLayout<'a>,
) {
let mut stack_data_structure = || {
let size = layout.stack_size(interner, TargetInfo::default_wasm32());
let size = interner.stack_size(layout);
if size == 0 {
<() as Wasm32Result>::insert_wrapper(arena, module, wrapper_name, main_fn_index);
} else {
@ -56,7 +55,7 @@ pub fn insert_wrapper_for_layout<'a>(
}
};
match layout {
match interner.get(layout) {
Layout::Builtin(Builtin::Int(IntWidth::U8 | IntWidth::I8)) => {
i8::insert_wrapper(arena, module, wrapper_name, main_fn_index);
}