mirror of
https://github.com/exoticorn/curlywas.git
synced 2026-01-20 11:46:43 +01:00
first running uw8 module
This commit is contained in:
10
src/emit.rs
10
src/emit.rs
@@ -44,11 +44,15 @@ pub fn emit(script: &ast::Script) -> Vec<u8> {
|
||||
memory64: false,
|
||||
}
|
||||
.into(),
|
||||
ast::ImportType::Variable { type_, name } => {
|
||||
ast::ImportType::Variable {
|
||||
type_,
|
||||
name,
|
||||
mutable,
|
||||
} => {
|
||||
globals.insert(name, globals.len() as u32);
|
||||
GlobalType {
|
||||
val_type: map_type(type_),
|
||||
mutable: false,
|
||||
mutable,
|
||||
}
|
||||
.into()
|
||||
}
|
||||
@@ -197,8 +201,8 @@ fn emit_block(ctx: &mut FunctionContext, block: &ast::Block) {
|
||||
value,
|
||||
..
|
||||
} => {
|
||||
emit_expression(ctx, value);
|
||||
emit_expression(ctx, &mem_location.left);
|
||||
emit_expression(ctx, value);
|
||||
let offset = if let ast::Expr::I32Const(v) = mem_location.right.expr {
|
||||
v as u32 as u64
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user