summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-03-24 00:06:29 +0100
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-03-24 00:06:29 +0100
commit84da57f4234b96a897476696152f86ca7ea101a7 (patch)
tree6d8fce9d7d310c2b899d5453150e9603222a182b
parentaa9bd918772039e45a7e2ff5f90a36488776af4c (diff)
gen: Add size checking for substituted variables
-rw-r--r--src/gen.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gen.rs b/src/gen.rs
index e50cddea..e23a929f 100644
--- a/src/gen.rs
+++ b/src/gen.rs
@@ -469,6 +469,14 @@ fn gen_globals(mut ctx: &mut GenCtx,
}
if let Some(substituted) = ctx.current_module().translations.get(&g.name()) {
+ match (substituted.layout(), g.layout()) {
+ (Some(l), Some(lg)) if l.size != lg.size => {},
+ (None, None) => {},
+ _ => {
+ // XXX real logger
+ println!("warning: substituted type for {} does not match its size", g.name());
+ }
+ }
g = substituted.clone();
}