Sprinkle some [[noreturn]] where possible

This commit is contained in:
jvoisin 2021-04-29 21:30:25 +02:00
parent 00c41e55a4
commit aec3c74fa5
13 changed files with 18 additions and 20 deletions

View file

@ -81,13 +81,13 @@ namespace Interpreter
abortUnknownSegment (code);
}
void Interpreter::abortUnknownCode (int segment, int opcode)
[[noreturn]] void Interpreter::abortUnknownCode (int segment, int opcode)
{
const std::string error = "unknown opcode " + std::to_string(opcode) + " in segment " + std::to_string(segment);
throw std::runtime_error (error);
}
void Interpreter::abortUnknownSegment (Type_Code code)
[[noreturn]] void Interpreter::abortUnknownSegment (Type_Code code)
{
const std::string error = "opcode outside of the allocated segment range: " + std::to_string(code);
throw std::runtime_error (error);

View file

@ -28,9 +28,9 @@ namespace Interpreter
void execute (Type_Code code);
void abortUnknownCode (int segment, int opcode);
[[noreturn]] void abortUnknownCode (int segment, int opcode);
void abortUnknownSegment (Type_Code code);
[[noreturn]] void abortUnknownSegment (Type_Code code);
void begin();