We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c1bf57 commit bf6eb51Copy full SHA for bf6eb51
src/assembly_scanner.cpp
@@ -1,5 +1,6 @@
1
#include "assembly_scanner.hh"
2
#include <cinttypes>
3
+#include <cstring>
4
#include <iostream>
5
#include <set>
6
@@ -112,6 +113,10 @@ NONNULL_PTR(const std::vector<NONNULL_PTR(std::vector<instruction>)>) assembly_s
112
113
cerr << "Instruction too short: " << curr_line << endl;
114
exit(EXIT_FAILURE);
115
}
116
+ if (curr_line.size() > 3 && !strchr(WHITESPACE, curr_line[3])) {
117
+ cerr << "Instruction too long: " << curr_line << endl;
118
+ exit(EXIT_FAILURE);
119
+ }
120
121
string instruction_name = curr_line.substr(0, 3);
122
instruction::operation opcode = assembly_scanner::opcode_for_name(instruction_name);
0 commit comments