aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexilla/test
diff options
context:
space:
mode:
Diffstat (limited to 'lexilla/test')
-rw-r--r--lexilla/test/examples/mmixal/references.mms16
-rw-r--r--lexilla/test/examples/mmixal/references.mms.styled16
2 files changed, 32 insertions, 0 deletions
diff --git a/lexilla/test/examples/mmixal/references.mms b/lexilla/test/examples/mmixal/references.mms
new file mode 100644
index 000000000..82be6e8c9
--- /dev/null
+++ b/lexilla/test/examples/mmixal/references.mms
@@ -0,0 +1,16 @@
+# Bug #2019 Buffer over-read in MMIXAL lexer
+label
+ PREFIX Foo:
+% Relative reference (uses PREFIX)
+ JMP label
+%
+ JMP @label
+% Absolute reference (does not use PREFIX)
+ JMP :label
+% In register list so treated as register
+ JMP :rA
+% Too long for buffer so truncated
+ JMP l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
+% Too long for buffer so truncated then treated as absolute
+ JMP :l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
+%
diff --git a/lexilla/test/examples/mmixal/references.mms.styled b/lexilla/test/examples/mmixal/references.mms.styled
new file mode 100644
index 000000000..78ae29a3a
--- /dev/null
+++ b/lexilla/test/examples/mmixal/references.mms.styled
@@ -0,0 +1,16 @@
+{1}# Bug #2019 Buffer over-read in MMIXAL lexer
+{2}label{4}
+{0} {5}PREFIX{7} {10}Foo:{1}
+% Relative reference (uses PREFIX)
+{0} {5}JMP{7} {10}label{1}
+%
+{0} {5}JMP{7} {10}@label{1}
+% Absolute reference (does not use PREFIX)
+{0} {5}JMP{7} {10}:label{1}
+% In register list so treated as register
+{0} {5}JMP{7} {13}:rA{1}
+% Too long for buffer so truncated
+{0} {5}JMP{7} {10}l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890{1}
+% Too long for buffer so truncated then treated as absolute
+{0} {5}JMP{7} {10}:l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890{1}
+%