Commit 4c5b1a35 by Greg Hartman Committed by Nicolas Capens

Remove uninformative error message details on division by zero.

Android does not support operator<< for long long. Instead of trying to use a supported type, we noticed that this error adds very little value so remove it wholesale. Change-Id: Id0c15a24f7a609bb6e61a4d0b9816eec80ffc1cf Reviewed-on: https://swiftshader-review.googlesource.com/2669Reviewed-by: 's avatarGreg Hartman <ghartman@google.com> Tested-by: 's avatarGreg Hartman <ghartman@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 6dbd5fef
......@@ -470,7 +470,7 @@ static const yytype_uint8 yyrline[] =
{
0, 85, 85, 92, 93, 96, 99, 102, 105, 108,
111, 114, 117, 120, 123, 126, 129, 132, 135, 138,
151, 164, 167, 170, 173, 176, 179
147, 156, 159, 162, 165, 168, 171
};
#endif
......@@ -1543,12 +1543,8 @@ yyreduce:
{
if ((yyvsp[(3) - (3)]) == 0) {
std::ostringstream stream;
stream << (yyvsp[(1) - (3)]) << " % " << (yyvsp[(3) - (3)]);
std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
context->token->location,
text.c_str());
context->token->location, "");
YYABORT;
} else {
(yyval) = (yyvsp[(1) - (3)]) % (yyvsp[(3) - (3)]);
......@@ -1560,12 +1556,8 @@ yyreduce:
{
if ((yyvsp[(3) - (3)]) == 0) {
std::ostringstream stream;
stream << (yyvsp[(1) - (3)]) << " / " << (yyvsp[(3) - (3)]);
std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
context->token->location,
text.c_str());
context->token->location, "");
YYABORT;
} else {
(yyval) = (yyvsp[(1) - (3)]) / (yyvsp[(3) - (3)]);
......
......@@ -137,12 +137,8 @@ expression
}
| expression '%' expression {
if ($3 == 0) {
std::ostringstream stream;
stream << $1 << " % " << $3;
std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
context->token->location,
text.c_str());
context->token->location, "");
YYABORT;
} else {
$$ = $1 % $3;
......@@ -150,12 +146,8 @@ expression
}
| expression '/' expression {
if ($3 == 0) {
std::ostringstream stream;
stream << $1 << " / " << $3;
std::string text = stream.str();
context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO,
context->token->location,
text.c_str());
context->token->location, "");
YYABORT;
} else {
$$ = $1 / $3;
......
#line 16 "./preprocessor/Tokenizer.l"
#line 16 "./Tokenizer.l"
//
// Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
......@@ -9,7 +9,7 @@
#line 13 "./preprocessor/Tokenizer.cpp"
#line 13 "./Tokenizer.cpp"
#define YY_INT_ALIGNED short int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment