summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-02 01:40:27 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-02 01:40:27 +0000
commit29c5a3b89c5127edd7754d2105ef64c88ac29566 (patch)
tree45c1acba31c10e0ed9491a7e45f81d36532790ec /parse.y
parent3f109150e03e5922667e58552f15435ef5799c0f (diff)
* parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switch
statement, and call rb_bug() if an unknown type is passed to negate_lit(). [ruby-core:56316] [Bug #8717] * bootstraptest/test_literal_suffix.rb (assert_equal): add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 0d11c17dae..3da3ad0c02 100644
--- a/parse.y
+++ b/parse.y
@@ -9402,6 +9402,8 @@ negate_lit(NODE *node)
node->nd_lit = LONG2FIX(-FIX2LONG(node->nd_lit));
break;
case T_BIGNUM:
+ case T_RATIONAL:
+ case T_COMPLEX:
node->nd_lit = rb_funcall(node->nd_lit,tUMINUS,0,0);
break;
case T_FLOAT:
@@ -9417,6 +9419,7 @@ negate_lit(NODE *node)
#endif
break;
default:
+ rb_bug("unknown literal type passed to negate_lit");
break;
}
return node;