diff --git a/src/printer.rs b/src/printer.rs index bcecd44..298eb84 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -33,7 +33,10 @@ use rustc_span::{ use serde::{Serialize, Serializer}; use stable_mir::{ mir::mono::{Instance, InstanceKind, MonoItem}, - mir::{alloc::AllocId, visit::MirVisitor, Body, LocalDecl, Rvalue, Terminator, TerminatorKind}, + mir::{ + alloc::AllocId, alloc::GlobalAlloc, visit::MirVisitor, Body, LocalDecl, Rvalue, Terminator, + TerminatorKind, + }, ty::{AdtDef, Allocation, ConstDef, ForeignItemKind, IndexedVal, RigidTy, TyKind, VariantIdx}, visitor::{Visitable, Visitor}, CrateDef, CrateItem, ItemKind, @@ -473,18 +476,8 @@ impl Serialize for ItemSource { } } -#[derive(Serialize)] -pub enum AllocInfo { - Function(stable_mir::mir::mono::Instance), - VTable( - stable_mir::ty::Ty, - Option>, - ), - Static(stable_mir::mir::mono::StaticDef), - Memory(stable_mir::ty::Allocation), // TODO include stable_mir::ty::TyKind? -} type LinkMap<'tcx> = HashMap, (ItemSource, FnSymType)>; -type AllocMap = HashMap; +type AllocMap = HashMap; type TyMap = HashMap)>; type SpanMap = HashMap; @@ -627,15 +620,18 @@ fn update_link_map<'tcx>( } } -fn get_prov_type(maybe_kind: Option) -> Option { +fn get_prov_ty(pointer_ty: stable_mir::ty::Ty) -> Option { use stable_mir::ty::RigidTy; + let pointer_kind = pointer_ty.kind(); // check for pointers - let kind = maybe_kind?; - if let Some(ty) = kind.builtin_deref(true) { - return ty.ty.kind().into(); + if let Some(ty) = pointer_kind.builtin_deref(true) { + return ty.ty.into(); } - match kind.rigid().expect("Non-rigid-ty allocation found!") { - RigidTy::Array(ty, _) | RigidTy::Slice(ty) | RigidTy::Ref(_, ty, _) => ty.kind().into(), + match pointer_kind + .rigid() + .expect("Non-rigid-ty allocation found!") + { + RigidTy::Array(ty, _) | RigidTy::Slice(ty) | RigidTy::Ref(_, ty, _) => (*ty).into(), RigidTy::FnPtr(_) | RigidTy::Adt(..) => None, // TODO: Check for Adt if the GenericArgs are related to prov unimplemented => { todo!("Unimplemented RigidTy allocation: {:?}", unimplemented); @@ -645,48 +641,50 @@ fn get_prov_type(maybe_kind: Option) -> Option, + ty: stable_mir::ty::Ty, val: stable_mir::mir::alloc::AllocId, ) { - use stable_mir::mir::alloc::GlobalAlloc; let entry = val_collector.visited_allocs.entry(val); if matches!(entry, std::collections::hash_map::Entry::Occupied(_)) { return; } + let kind = ty.kind(); let global_alloc = GlobalAlloc::from(val); match global_alloc { GlobalAlloc::Memory(ref alloc) => { - let pointed_kind = get_prov_type(kind); + let pointed_ty = get_prov_ty(ty); if debug_enabled() { println!( "DEBUG: called collect_alloc: {:?}:{:?}:{:?}", - val, pointed_kind, global_alloc + val, + pointed_ty.map(|ty| ty.kind()), + global_alloc ); } - entry.or_insert(AllocInfo::Memory(alloc.clone())); // TODO: include pointed_kind.clone().unwrap() ? + entry.or_insert((ty, global_alloc.clone())); alloc.provenance.ptrs.iter().for_each(|(_, prov)| { - collect_alloc(val_collector, pointed_kind.clone(), prov.0); + collect_alloc(val_collector, pointed_ty.unwrap(), prov.0); }); } - GlobalAlloc::Static(def) => { + GlobalAlloc::Static(_) => { assert!( - kind.clone().unwrap().builtin_deref(true).is_some(), + kind.clone().builtin_deref(true).is_some(), "Allocated pointer is not a built-in pointer type: {:?}", kind ); - entry.or_insert(AllocInfo::Static(def)); + entry.or_insert((ty, global_alloc.clone())); } - GlobalAlloc::VTable(ty, traitref) => { + GlobalAlloc::VTable(_, _) => { assert!( - kind.clone().unwrap().builtin_deref(true).is_some(), + kind.clone().builtin_deref(true).is_some(), "Allocated pointer is not a built-in pointer type: {:?}", kind ); - entry.or_insert(AllocInfo::VTable(ty, traitref)); + entry.or_insert((ty, global_alloc.clone())); } - GlobalAlloc::Function(inst) => { - assert!(kind.unwrap().is_fn_ptr()); - entry.or_insert(AllocInfo::Function(inst)); + GlobalAlloc::Function(_) => { + assert!(kind.is_fn_ptr()); + entry.or_insert((ty, global_alloc.clone())); } }; } @@ -770,9 +768,11 @@ impl MirVisitor for InternedValueCollector<'_, '_> { constant.ty().kind() ); } - alloc.provenance.ptrs.iter().for_each(|(_offset, prov)| { - collect_alloc(self, Some(constant.ty().kind()), prov.0) - }); + alloc + .provenance + .ptrs + .iter() + .for_each(|(_offset, prov)| collect_alloc(self, constant.ty(), prov.0)); } ConstantKind::Ty(ty_const) => { if let TyConstKind::Value(..) = ty_const.kind() { @@ -1082,7 +1082,7 @@ type SourceData = (String, usize, usize, usize, usize); pub struct SmirJson<'t> { pub name: String, pub crate_id: u64, - pub allocs: Vec<(AllocId, AllocInfo)>, + pub allocs: Vec, pub functions: Vec<(LinkMapKey<'t>, FnSymType)>, pub uneval_consts: Vec<(ConstDef, String)>, pub items: Vec, @@ -1099,6 +1099,13 @@ pub struct SmirJsonDebugInfo<'t> { foreign_modules: Vec<(String, Vec)>, } +#[derive(Serialize)] +pub struct AllocInfo { + alloc_id: AllocId, + ty: stable_mir::ty::Ty, + global_alloc: GlobalAlloc, +} + // Serialization Entrypoint // ======================== @@ -1112,7 +1119,7 @@ pub fn collect_smir(tcx: TyCtxt<'_>) -> SmirJson { // FIXME: We dump extra static items here --- this should be handled better for (_, alloc) in visited_allocs.iter() { - if let AllocInfo::Static(def) = alloc { + if let (_, GlobalAlloc::Static(def)) = alloc { let mono_item = stable_mir::mir::mono::MonoItem::Fn(stable_mir::mir::mono::Instance::from(*def)); let item_name = &mono_item_name(tcx, &mono_item); @@ -1145,7 +1152,14 @@ pub fn collect_smir(tcx: TyCtxt<'_>) -> SmirJson { .into_iter() .map(|(k, (_, name))| (k, name)) .collect::>(); - let mut allocs = visited_allocs.into_iter().collect::>(); + let mut allocs = visited_allocs + .into_iter() + .map(|(alloc_id, (ty, global_alloc))| AllocInfo { + alloc_id, + ty, + global_alloc, + }) + .collect::>(); let crate_id = tcx.stable_crate_id(LOCAL_CRATE).as_u64(); let mut types = visited_tys @@ -1158,7 +1172,7 @@ pub fn collect_smir(tcx: TyCtxt<'_>) -> SmirJson { let mut spans = span_map.into_iter().collect::>(); // sort output vectors to stabilise output (a bit) - allocs.sort_by(|a, b| a.0.to_index().cmp(&b.0.to_index())); + allocs.sort_by(|a, b| a.alloc_id.to_index().cmp(&b.alloc_id.to_index())); functions.sort_by(|a, b| a.0 .0.to_index().cmp(&b.0 .0.to_index())); items.sort(); types.sort_by(|a, b| a.0.to_index().cmp(&b.0.to_index())); diff --git a/tests/integration/normalise-filter.jq b/tests/integration/normalise-filter.jq index 8ef194a..41446a3 100644 --- a/tests/integration/normalise-filter.jq +++ b/tests/integration/normalise-filter.jq @@ -2,7 +2,7 @@ .functions = ( [ .functions[] | if .[1].NormalSym then .[1].NormalSym = .[1].NormalSym[:-17] else . end ] ) | .items = ( [ .items[] | if .symbol_name then .symbol_name = .symbol_name[:-17] else . end ] ) # delete unstable alloc, function, and type IDs - | .allocs = ( [ .allocs[] ] | map(del(.[0])) ) + | .allocs = ( .allocs | map(del(.alloc_id)) | map(del(.ty)) ) | .functions = ( [ .functions[] ] | map(del(.[0])) ) | .types = ( [ .types[] ] | map(del(.[0])) ) | diff --git a/tests/integration/programs/binop.smir.json.expected b/tests/integration/programs/binop.smir.json.expected index 2edfbc7..3e48b95 100644 --- a/tests/integration/programs/binop.smir.json.expected +++ b/tests/integration/programs/binop.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -41,9 +41,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -83,9 +83,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -128,9 +128,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -170,9 +170,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -213,9 +213,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -258,9 +258,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -301,9 +301,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -346,9 +346,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -391,9 +391,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -436,9 +436,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -477,9 +477,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -518,9 +518,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -559,9 +559,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -600,9 +600,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -641,9 +641,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -682,9 +682,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -724,9 +724,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -766,9 +766,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -808,9 +808,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -850,9 +850,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -890,9 +890,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -931,9 +931,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -976,9 +976,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -1016,9 +1016,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -1057,9 +1057,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -1102,7 +1102,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/char-trivial.smir.json.expected b/tests/integration/programs/char-trivial.smir.json.expected index 04ca180..aa31cf4 100644 --- a/tests/integration/programs/char-trivial.smir.json.expected +++ b/tests/integration/programs/char-trivial.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -38,7 +38,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/closure-args.smir.json.expected b/tests/integration/programs/closure-args.smir.json.expected index 9c34168..e7946e6 100644 --- a/tests/integration/programs/closure-args.smir.json.expected +++ b/tests/integration/programs/closure-args.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -47,7 +47,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/closure-no-args.smir.json.expected b/tests/integration/programs/closure-no-args.smir.json.expected index 642f5af..44cf507 100644 --- a/tests/integration/programs/closure-no-args.smir.json.expected +++ b/tests/integration/programs/closure-no-args.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -41,7 +41,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/const-arithm-simple.smir.json.expected b/tests/integration/programs/const-arithm-simple.smir.json.expected index 4017f61..9995fb7 100644 --- a/tests/integration/programs/const-arithm-simple.smir.json.expected +++ b/tests/integration/programs/const-arithm-simple.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -31,7 +31,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/div.smir.json.expected b/tests/integration/programs/div.smir.json.expected index 0378460..9eac071 100644 --- a/tests/integration/programs/div.smir.json.expected +++ b/tests/integration/programs/div.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -44,7 +44,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/double-ref-deref.smir.json.expected b/tests/integration/programs/double-ref-deref.smir.json.expected index 5d7f7fc..5c3b310 100644 --- a/tests/integration/programs/double-ref-deref.smir.json.expected +++ b/tests/integration/programs/double-ref-deref.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -39,7 +39,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/fibonacci.smir.json.expected b/tests/integration/programs/fibonacci.smir.json.expected index 4dadef9..1454e96 100644 --- a/tests/integration/programs/fibonacci.smir.json.expected +++ b/tests/integration/programs/fibonacci.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -38,7 +38,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/float.smir.json.expected b/tests/integration/programs/float.smir.json.expected index a47af87..25be1a3 100644 --- a/tests/integration/programs/float.smir.json.expected +++ b/tests/integration/programs/float.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -42,9 +42,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -85,7 +85,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/modulo.smir.json.expected b/tests/integration/programs/modulo.smir.json.expected index 27f0fde..60b0d2a 100644 --- a/tests/integration/programs/modulo.smir.json.expected +++ b/tests/integration/programs/modulo.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -42,7 +42,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/mutual_recursion.smir.json.expected b/tests/integration/programs/mutual_recursion.smir.json.expected index a8616e2..98e6012 100644 --- a/tests/integration/programs/mutual_recursion.smir.json.expected +++ b/tests/integration/programs/mutual_recursion.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -41,7 +41,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/primitive-type-bounds.smir.json.expected b/tests/integration/programs/primitive-type-bounds.smir.json.expected index c3bd408..60bd3a3 100644 --- a/tests/integration/programs/primitive-type-bounds.smir.json.expected +++ b/tests/integration/programs/primitive-type-bounds.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -36,7 +36,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/recursion-simple-match.smir.json.expected b/tests/integration/programs/recursion-simple-match.smir.json.expected index b867356..d8f8ce3 100644 --- a/tests/integration/programs/recursion-simple-match.smir.json.expected +++ b/tests/integration/programs/recursion-simple-match.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -39,7 +39,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/recursion-simple.smir.json.expected b/tests/integration/programs/recursion-simple.smir.json.expected index 82c7323..cab6049 100644 --- a/tests/integration/programs/recursion-simple.smir.json.expected +++ b/tests/integration/programs/recursion-simple.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -39,7 +39,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/ref-deref.smir.json.expected b/tests/integration/programs/ref-deref.smir.json.expected index e3f520e..674aabd 100644 --- a/tests/integration/programs/ref-deref.smir.json.expected +++ b/tests/integration/programs/ref-deref.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -37,7 +37,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/shl_min.smir.json.expected b/tests/integration/programs/shl_min.smir.json.expected index 2e37932..0bdc119 100644 --- a/tests/integration/programs/shl_min.smir.json.expected +++ b/tests/integration/programs/shl_min.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -47,9 +47,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -98,9 +98,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -154,9 +154,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -219,9 +219,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -305,7 +305,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/slice.smir.json.expected b/tests/integration/programs/slice.smir.json.expected index 052ee0e..35aac31 100644 --- a/tests/integration/programs/slice.smir.json.expected +++ b/tests/integration/programs/slice.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 4, "bytes": [ @@ -20,9 +20,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -62,7 +62,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/strange-ref-deref.smir.json.expected b/tests/integration/programs/strange-ref-deref.smir.json.expected index 9e0e99a..d6fa6f0 100644 --- a/tests/integration/programs/strange-ref-deref.smir.json.expected +++ b/tests/integration/programs/strange-ref-deref.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -38,7 +38,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/struct.smir.json.expected b/tests/integration/programs/struct.smir.json.expected index fd1ec2c..a183ab4 100644 --- a/tests/integration/programs/struct.smir.json.expected +++ b/tests/integration/programs/struct.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -44,7 +44,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/sum-to-n.smir.json.expected b/tests/integration/programs/sum-to-n.smir.json.expected index b52b5d9..29f8119 100644 --- a/tests/integration/programs/sum-to-n.smir.json.expected +++ b/tests/integration/programs/sum-to-n.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -36,7 +36,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/tuple-eq.smir.json.expected b/tests/integration/programs/tuple-eq.smir.json.expected index ba0c1e3..9435f73 100644 --- a/tests/integration/programs/tuple-eq.smir.json.expected +++ b/tests/integration/programs/tuple-eq.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 4, "bytes": [ @@ -20,9 +20,9 @@ } } } - ], - [ - { + }, + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -66,7 +66,7 @@ } } } - ] + } ], "functions": [ [ diff --git a/tests/integration/programs/tuples-simple.smir.json.expected b/tests/integration/programs/tuples-simple.smir.json.expected index 55ffc13..20f3995 100644 --- a/tests/integration/programs/tuples-simple.smir.json.expected +++ b/tests/integration/programs/tuples-simple.smir.json.expected @@ -1,7 +1,7 @@ { "allocs": [ - [ - { + { + "global_alloc": { "Memory": { "align": 1, "bytes": [ @@ -44,7 +44,7 @@ } } } - ] + } ], "functions": [ [