Skip to content

Commit e731520

Browse files
committed
Add helper function to double-check non-null types.
1 parent 244c59a commit e731520

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/comp/middle/trans.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ fn T_taskptr() -> TypeRef {
239239
}
240240

241241
fn type_of(@trans_ctxt cx, @typeck.ty t) -> TypeRef {
242+
let TypeRef llty = type_of_inner(cx, t);
243+
check (llty as int != 0);
244+
ret llty;
245+
}
246+
247+
fn type_of_inner(@trans_ctxt cx, @typeck.ty t) -> TypeRef {
242248
alt (t.struct) {
243249
case (typeck.ty_nil) { ret T_nil(); }
244250
case (typeck.ty_bool) { ret T_bool(); }

0 commit comments

Comments
 (0)