From b79a713b5c2e02058d51a24d11813f4d19549508 Mon Sep 17 00:00:00 2001 From: Chunmyong Park Date: Sun, 14 Jun 2020 12:59:12 +0000 Subject: [PATCH] Update IR interpreter --- src/ir/interp.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ir/interp.rs b/src/ir/interp.rs index 24329e4..9e8a929 100644 --- a/src/ir/interp.rs +++ b/src/ir/interp.rs @@ -611,8 +611,8 @@ mod calculator { rhs: Value, ) -> Result { match (lhs, rhs) { - (Value::Undef { .. }, _) => Err(()), - (_, Value::Undef { .. }) => Err(()), + (Value::Undef { dtype }, _) => Ok(Value::undef(dtype)), + (_, Value::Undef { dtype }) => Ok(Value::undef(dtype)), ( Value::Int { value: lhs, @@ -688,7 +688,7 @@ mod calculator { operand: Value, ) -> Result { match operand { - Value::Undef { .. } => Err(()), + Value::Undef { dtype } => Ok(Value::undef(dtype)), Value::Int { value, width, @@ -741,7 +741,7 @@ mod calculator { } match (value, dtype) { - (Value::Undef { .. }, _) => Err(()), + (Value::Undef { .. }, dtype) => Ok(Value::undef(dtype)), ( Value::Int { value, width, .. }, Dtype::Int {