From 7c8ec5a5edbdae184ce5c0f6bbcde6037340f209 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 8 Oct 2020 18:10:27 -0400 Subject: [PATCH] Add a test case for charmaps that segfaults prior to this fix --- test/asm/charmap-inheritance.asm | 23 +++++++++++++++++++++++ test/asm/charmap-inheritance.err | 0 test/asm/charmap-inheritance.out | 0 3 files changed, 23 insertions(+) create mode 100644 test/asm/charmap-inheritance.asm create mode 100644 test/asm/charmap-inheritance.err create mode 100644 test/asm/charmap-inheritance.out diff --git a/test/asm/charmap-inheritance.asm b/test/asm/charmap-inheritance.asm new file mode 100644 index 00000000..eab9c12f --- /dev/null +++ b/test/asm/charmap-inheritance.asm @@ -0,0 +1,23 @@ +SECTION "test", ROM0 + + newcharmap foo + + charmap "", $00 + charmap "", $01 + charmap "", $02 + charmap "", $03 + charmap "", $04 + charmap "", $05 + charmap "", $06 + charmap "", $07 + charmap "", $08 + + ; At this point, enough nodes were allocated for 'foo' to be reallocated. + ; Its value in the charmaps' hashmap should have been updated too, + ; so that usages of 'foo' will not segfault. + + ; This uses 'foo; by switching to it. + setcharmap foo + + ; This uses 'foo' by deriving another charmap from it. + newcharmap bar, foo diff --git a/test/asm/charmap-inheritance.err b/test/asm/charmap-inheritance.err new file mode 100644 index 00000000..e69de29b diff --git a/test/asm/charmap-inheritance.out b/test/asm/charmap-inheritance.out new file mode 100644 index 00000000..e69de29b