Fix wrong evaluation of STRING_STOI (#2252)
authorAndres Noetzli <andres.noetzli@gmail.com>
Wed, 1 Aug 2018 23:08:47 +0000 (16:08 -0700)
committerAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 1 Aug 2018 23:08:47 +0000 (18:08 -0500)
src/theory/evaluator.cpp

index dd40ace8a07e3b3bfadcddf56e8987905a40efc0..02083069d016f50d72f988132e898ee33642d728 100644 (file)
@@ -434,11 +434,11 @@ EvalResult Evaluator::evalInternal(TNode n,
           const String& s = results[currNode[0]].d_str;
           if (s.isNumber())
           {
-            results[currNode] = EvalResult(Rational(-1));
+            results[currNode] = EvalResult(Rational(s.toNumber()));
           }
           else
           {
-            results[currNode] = EvalResult(Rational(s.toNumber()));
+            results[currNode] = EvalResult(Rational(-1));
           }
           break;
         }