Skip to content

Commit 08ffe30

Browse files
committed
[ASM] Fix function duplication error
1 parent 0959047 commit 08ffe30

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

cli/asm_commander.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ int AsmCommander::assemble() {
6060
fprintf(stderr, "%s: Pass %d\n", _input_name, ++pass);
6161
prev.swap(memory);
6262
symbols.copy(_driver.symbols());
63+
_driver.symbols().clearFunctions();
6364
memory.clear();
6465
listout.clear();
6566
errorout.clear();

driver/symbol_store.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ void SymbolStoreImpl::copy(const SymbolStoreImpl &other) {
3838
void SymbolStoreImpl::clear() {
3939
_symbols.clear();
4040
_variables.clear();
41+
clearFunctions();
42+
}
43+
44+
void SymbolStoreImpl::clearFunctions() {
4145
_functions.clear();
4246
}
4347

driver/symbol_store.h

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct SymbolStoreImpl final : SymbolStore {
4444
bool operator!=(const SymbolStoreImpl &other) const { return !(*this == other); }
4545
void copy(const SymbolStoreImpl &other);
4646
void clear();
47+
void clearFunctions();
4748

4849
// SymbolTable
4950
const char *lookupValue(uint32_t) const override { return nullptr; }

0 commit comments

Comments
 (0)