mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Charmaps cannot map an empty string (#1486)
This commit is contained in:
@@ -105,6 +105,11 @@ void charmap_Pop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void charmap_Add(std::string const &mapping, std::vector<int32_t> &&value) {
|
void charmap_Add(std::string const &mapping, std::vector<int32_t> &&value) {
|
||||||
|
if (mapping.empty()) {
|
||||||
|
error("Cannot map an empty string\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Charmap &charmap = *currentCharmap;
|
Charmap &charmap = *currentCharmap;
|
||||||
size_t nodeIdx = 0;
|
size_t nodeIdx = 0;
|
||||||
|
|
||||||
|
|||||||
2
test/asm/charmap-empty.asm
Normal file
2
test/asm/charmap-empty.asm
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
charmap "", 1
|
||||||
|
charmap "nonempty", ; nothing
|
||||||
5
test/asm/charmap-empty.err
Normal file
5
test/asm/charmap-empty.err
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
error: charmap-empty.asm(1):
|
||||||
|
Cannot map an empty string
|
||||||
|
error: charmap-empty.asm(2):
|
||||||
|
syntax error, unexpected newline
|
||||||
|
error: Assembly aborted (2 errors)!
|
||||||
Reference in New Issue
Block a user