Skip to content

Commit

Permalink
Bugfix Map usage (#4265)
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf committed Nov 9, 2022
1 parent d41eb5c commit 17a56af
Show file tree
Hide file tree
Showing 18 changed files with 1,064 additions and 59 deletions.
2 changes: 1 addition & 1 deletion lib/parsers/asm-parser-cc65.ts
Expand Up @@ -77,7 +77,7 @@ export class CC65AsmParser extends AsmParser {
return {asm: [{text: asmLines[0], source: null}]};
}

const labelDefinitions: Map<string, number> = new Map<string, number>();
const labelDefinitions: Record<string, number> = {};

for (const line of asmLines) {
let match = line.match(this.commentRe);
Expand Down
2 changes: 1 addition & 1 deletion lib/parsers/asm-parser-spirv.ts
Expand Up @@ -98,7 +98,7 @@ export class SPIRVAsmParser extends AsmParser {
const endTime = process.hrtime.bigint();
return {
asm: asm,
labelDefinitions: new Map<string, number>(),
labelDefinitions: {},
parsingTime: ((endTime - startTime) / BigInt(1000000)).toString(),
filteredCount: startingLineCount - asm.length,
};
Expand Down
4 changes: 2 additions & 2 deletions lib/parsers/asm-parser.ts
Expand Up @@ -333,7 +333,7 @@ export class AsmParser extends AsmRegex {
}

const asm: ParsedAsmResultLine[] = [];
const labelDefinitions: Map<string, number> = new Map<string, number>();
const labelDefinitions: Record<string, number> = {};

let asmLines = utils.splitLines(asmResult);
const startingLineCount = asmLines.length;
Expand Down Expand Up @@ -598,7 +598,7 @@ export class AsmParser extends AsmRegex {
processBinaryAsm(asmResult, filters): ParsedAsmResult {
const startTime = process.hrtime.bigint();
const asm: ParsedAsmResultLine[] = [];
const labelDefinitions: Map<string, number> = new Map<string, number>();
const labelDefinitions: Record<string, number> = {};
const dontMaskFilenames = filters.dontMaskFilenames;

let asmLines = asmResult.split('\n');
Expand Down
20 changes: 2 additions & 18 deletions test/filters-cases/bug-1285.asm.none.approved.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 3 additions & 27 deletions test/filters-cases/eigen-test.asm.none.approved.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions test/filters-cases/gcc-x86-vector.asm.none.approved.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions test/filters-cases/intsize.asm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions test/filters-cases/intsize.asm.directives.approved.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions test/filters-cases/intsize.asm.directives.comments.approved.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 17a56af

Please sign in to comment.