mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 11:16:42 +01:00
fix export section not written when needed
This commit is contained in:
6
default.nix
Normal file
6
default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
with import <nixpkgs> {};
|
||||
stdenv.mkDerivation {
|
||||
name = "dev-environment"; # Probably put a more meaningful name here
|
||||
buildInputs = [ pkg-config libxkbcommon ];
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ fn print_help() {
|
||||
println!(
|
||||
"Usage:
|
||||
uw8-tool make-base <version>
|
||||
uw8-tool pack <wasm file> <uw8 file>"
|
||||
uw8-tool pack <wasm file> <uw8 file>
|
||||
uw8-tool unpack <uw8 file> <wasm file>"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -370,21 +370,20 @@ impl<'a> ParsedModule<'a> {
|
||||
}
|
||||
|
||||
{
|
||||
let mut base_exports = base.exports.clone();
|
||||
base_exports.sort();
|
||||
let base_exports = base.exports.clone();
|
||||
|
||||
let mut my_exports: Vec<(String, u32)> = self
|
||||
let my_exports: Vec<(String, u32)> = self
|
||||
.exports
|
||||
.data
|
||||
.iter()
|
||||
.map(|(name, func)| (name.clone(), *function_map.get(func).unwrap()))
|
||||
.collect();
|
||||
my_exports.sort();
|
||||
|
||||
if base_exports
|
||||
.iter()
|
||||
.zip(my_exports.iter())
|
||||
.any(|((n1, t1), (n2, t2))| n1 != n2 && t1 != t2)
|
||||
if base_exports.len() != my_exports.len()
|
||||
|| base_exports
|
||||
.iter()
|
||||
.zip(my_exports.iter())
|
||||
.any(|((n1, t1), (n2, t2))| n1 != n2 || t1 != t2)
|
||||
{
|
||||
let mut export_section = enc::ExportSection::new();
|
||||
for (name, fnc) in my_exports {
|
||||
|
||||
Reference in New Issue
Block a user