about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-11-20 22:04:34 -0800
committerGraydon Hoare <graydon@mozilla.com>2010-11-20 22:04:34 -0800
commite731520be5d43059b5b87ffc8e1b249e4a824a9a (patch)
tree25e073de490a71703744adf9938d0f04d4d84b0a /src/comp
parent244c59ac205fdb28128908f39d39b3eb9cb7a772 (diff)
Add helper function to double-check non-null types.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 091896fa302..b93235f2c5b 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -239,6 +239,12 @@ fn T_taskptr() -> TypeRef {
 }
 
 fn type_of(@trans_ctxt cx, @typeck.ty t) -> TypeRef {
+    let TypeRef llty = type_of_inner(cx, t);
+    check (llty as int != 0);
+    ret llty;
+}
+
+fn type_of_inner(@trans_ctxt cx, @typeck.ty t) -> TypeRef {
     alt (t.struct) {
         case (typeck.ty_nil) { ret T_nil(); }
         case (typeck.ty_bool) { ret T_bool(); }