mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add explicit throws after some assertions to work around a spurious warning in GCC 12.1
This commit is contained in:
parent
f5e421ff91
commit
539e139555
@ -19,6 +19,7 @@
|
|||||||
#include <libsmtutil/CVC4Interface.h>
|
#include <libsmtutil/CVC4Interface.h>
|
||||||
|
|
||||||
#include <libsolutil/CommonIO.h>
|
#include <libsolutil/CommonIO.h>
|
||||||
|
#include <libsolutil/Exceptions.h>
|
||||||
|
|
||||||
#include <cvc4/util/bitvector.h>
|
#include <cvc4/util/bitvector.h>
|
||||||
|
|
||||||
@ -289,6 +290,9 @@ CVC4::Expr CVC4Interface::toCVC4Expr(Expression const& _expr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
smtAssert(false, "");
|
smtAssert(false, "");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
CVC4::Type CVC4Interface::cvc4Sort(Sort const& _sort)
|
CVC4::Type CVC4Interface::cvc4Sort(Sort const& _sort)
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <libsolutil/CommonData.h>
|
#include <libsolutil/CommonData.h>
|
||||||
#include <libsolutil/CommonIO.h>
|
#include <libsolutil/CommonIO.h>
|
||||||
|
#include <libsolutil/Exceptions.h>
|
||||||
|
|
||||||
#ifdef HAVE_Z3_DLOPEN
|
#ifdef HAVE_Z3_DLOPEN
|
||||||
#include <libsmtutil/Z3Loader.h>
|
#include <libsmtutil/Z3Loader.h>
|
||||||
@ -271,6 +272,9 @@ z3::expr Z3Interface::toZ3Expr(Expression const& _expr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
smtAssert(false, "");
|
smtAssert(false, "");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression Z3Interface::fromZ3Expr(z3::expr const& _expr)
|
Expression Z3Interface::fromZ3Expr(z3::expr const& _expr)
|
||||||
@ -379,6 +383,9 @@ Expression Z3Interface::fromZ3Expr(z3::expr const& _expr)
|
|||||||
return Expression(_expr.decl().name().str(), arguments, fromZ3Sort(_expr.get_sort()));
|
return Expression(_expr.decl().name().str(), arguments, fromZ3Sort(_expr.get_sort()));
|
||||||
|
|
||||||
smtAssert(false, "");
|
smtAssert(false, "");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
z3::sort Z3Interface::z3Sort(Sort const& _sort)
|
z3::sort Z3Interface::z3Sort(Sort const& _sort)
|
||||||
|
@ -229,6 +229,9 @@ ASTPointer<ASTNode> ASTJsonImporter::convertJsonToASTNode(Json::Value const& _js
|
|||||||
return createDocumentation(_json);
|
return createDocumentation(_json);
|
||||||
else
|
else
|
||||||
astAssert(false, "Unknown type of ASTNode: " + nodeType);
|
astAssert(false, "Unknown type of ASTNode: " + nodeType);
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============ functions to instantiate the AST-Nodes from Json-Nodes ==============
|
// ============ functions to instantiate the AST-Nodes from Json-Nodes ==============
|
||||||
@ -1073,6 +1076,9 @@ Visibility ASTJsonImporter::visibility(Json::Value const& _node)
|
|||||||
return Visibility::External;
|
return Visibility::External;
|
||||||
else
|
else
|
||||||
astAssert(false, "Unknown visibility declaration");
|
astAssert(false, "Unknown visibility declaration");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
VariableDeclaration::Location ASTJsonImporter::location(Json::Value const& _node)
|
VariableDeclaration::Location ASTJsonImporter::location(Json::Value const& _node)
|
||||||
@ -1092,6 +1098,9 @@ VariableDeclaration::Location ASTJsonImporter::location(Json::Value const& _node
|
|||||||
return VariableDeclaration::Location::CallData;
|
return VariableDeclaration::Location::CallData;
|
||||||
else
|
else
|
||||||
astAssert(false, "Unknown location declaration");
|
astAssert(false, "Unknown location declaration");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
Literal::SubDenomination ASTJsonImporter::subdenomination(Json::Value const& _node)
|
Literal::SubDenomination ASTJsonImporter::subdenomination(Json::Value const& _node)
|
||||||
@ -1125,6 +1134,9 @@ Literal::SubDenomination ASTJsonImporter::subdenomination(Json::Value const& _no
|
|||||||
return Literal::SubDenomination::Year;
|
return Literal::SubDenomination::Year;
|
||||||
else
|
else
|
||||||
astAssert(false, "Unknown subdenomination");
|
astAssert(false, "Unknown subdenomination");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
StateMutability ASTJsonImporter::stateMutability(Json::Value const& _node)
|
StateMutability ASTJsonImporter::stateMutability(Json::Value const& _node)
|
||||||
@ -1142,6 +1154,9 @@ StateMutability ASTJsonImporter::stateMutability(Json::Value const& _node)
|
|||||||
return StateMutability::Payable;
|
return StateMutability::Payable;
|
||||||
else
|
else
|
||||||
astAssert(false, "Unknown stateMutability");
|
astAssert(false, "Unknown stateMutability");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1653,6 +1653,9 @@ ASTPointer<Statement> Parser::parseSimpleStatement(ASTPointer<ASTString> const&
|
|||||||
solAssert(false, "");
|
solAssert(false, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Parser::IndexAccessedPath::empty() const
|
bool Parser::IndexAccessedPath::empty() const
|
||||||
|
@ -110,6 +110,9 @@ Statement AsmJsonImporter::createStatement(Json::Value const& _node)
|
|||||||
return createBlock(_node);
|
return createBlock(_node);
|
||||||
else
|
else
|
||||||
yulAssert(false, "Invalid nodeType as statement");
|
yulAssert(false, "Invalid nodeType as statement");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression AsmJsonImporter::createExpression(Json::Value const& _node)
|
Expression AsmJsonImporter::createExpression(Json::Value const& _node)
|
||||||
@ -129,6 +132,9 @@ Expression AsmJsonImporter::createExpression(Json::Value const& _node)
|
|||||||
return createLiteral(_node);
|
return createLiteral(_node);
|
||||||
else
|
else
|
||||||
yulAssert(false, "Invalid nodeType as expression");
|
yulAssert(false, "Invalid nodeType as expression");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<Expression> AsmJsonImporter::createExpressionVector(Json::Value const& _array)
|
vector<Expression> AsmJsonImporter::createExpressionVector(Json::Value const& _array)
|
||||||
|
@ -371,6 +371,9 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
yulAssert(false, "");
|
yulAssert(false, "");
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw std::exception();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -276,6 +276,9 @@ unique_ptr<FitnessMetric> FitnessMetricFactory::build(
|
|||||||
default:
|
default:
|
||||||
assertThrow(false, solidity::util::Exception, "Invalid MetricAggregatorChoice value.");
|
assertThrow(false, solidity::util::Exception, "Invalid MetricAggregatorChoice value.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Workaround for spurious GCC 12.1 warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105794)
|
||||||
|
throw exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
PopulationFactory::Options PopulationFactory::Options::fromCommandLine(po::variables_map const& _arguments)
|
PopulationFactory::Options PopulationFactory::Options::fromCommandLine(po::variables_map const& _arguments)
|
||||||
|
Loading…
Reference in New Issue
Block a user