To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 692c2901 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano
Browse files

More helpfull integer constant error message...

parent 0e1102ee
...@@ -381,7 +381,8 @@ namespace C ...@@ -381,7 +381,8 @@ namespace C
virtual Any<std::string> visitCtorInt(UIRParser::CtorIntContext *context) override { virtual Any<std::string> visitCtorInt(UIRParser::CtorIntContext *context) override {
auto val = accept<std::string>(context->intLiteral()); auto val = accept<std::string>(context->intLiteral());
if (!int_sizes.count(current_type)) if (!int_sizes.count(current_type))
throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant)"); throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant) at " +
context->getSourceInterval().toString());
std::size_t size = (std::size_t)int_sizes[current_type]; std::size_t size = (std::size_t)int_sizes[current_type];
std::string id; std::string id;
......
...@@ -325,7 +325,8 @@ namespace Runtime ...@@ -325,7 +325,8 @@ namespace Runtime
virtual Any<MuVarNode> visitCtorInt(UIRParser::CtorIntContext *context) override { virtual Any<MuVarNode> visitCtorInt(UIRParser::CtorIntContext *context) override {
auto val = accept<std::string>(context->intLiteral()); auto val = accept<std::string>(context->intLiteral());
if (!int_sizes.count(current_type)) if (!int_sizes.count(current_type))
throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant)"); throw antlr4::RuntimeException("Cannot determine size of integer constant (make sure the type declaration preceds the constant) at " +
context->getSourceInterval().toString());
std::size_t size = (std::size_t)int_sizes[current_type]; std::size_t size = (std::size_t)int_sizes[current_type];
MuID id; MuID id;
......
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