public override void Emit (EmitContext ec)
{
Store (ec);
- AddressOf (ec, AddressOp.LoadStore);
- ec.ig.EmitCall (OpCodes.Call, info.Value, null);
+ Invocation.EmitCall (ec, false, this, info.Value, null, loc);
}
public void EmitCheck (EmitContext ec)
{
Store (ec);
- AddressOf (ec, AddressOp.LoadStore);
- ec.ig.EmitCall (OpCodes.Call, info.HasValue, null);
+ Invocation.EmitCall (ec, false, this, info.HasValue, null, loc);
}
public void EmitGetValueOrDefault (EmitContext ec)
{
Store (ec);
- AddressOf (ec, AddressOp.LoadStore);
- ec.ig.EmitCall (OpCodes.Call, info.GetValueOrDefault, null);
+ Invocation.EmitCall (ec, false, this, info.GetValueOrDefault, null, loc);
}
public override bool Equals (object obj)
// Arguments can be lifted for equal operators when the return type is bool and both
// arguments are of same type
//
- if (left is NullLiteral) {
+ if (left_orig.IsNull) {
left = right;
left_null_lifted = true;
type = TypeManager.bool_type;
}
- if (right is NullLiteral) {
+ if (right_orig.IsNull) {
right = left;
right_null_lifted = true;
type = TypeManager.bool_type;
if ((Oper & Operator.ComparisonMask) != 0) {
//
- // Emit true when equality operator both operands are null
- // or inequality operator operands has only one null
+ // Emit true when equality operator both operands are same
+ // or inequality operator operands are not
//
- if ((Oper == Operator.Equality && left_unwrap != null && right_unwrap != null) ||
+ if ((Oper == Operator.Equality && left_unwrap == right_unwrap) ||
(Oper == Operator.Inequality && left_unwrap != right_unwrap))
ig.Emit (OpCodes.Ldc_I4_1);
else