]> Shamusworld >> Repos - rmac/commitdiff
Fix for #203. Thanks to Steven Tattersall for the report.
authorggn <ggn@atari.org>
Sun, 19 Jun 2022 20:16:23 +0000 (23:16 +0300)
committerShamus Hammons <jlhamm@acm.org>
Mon, 27 Jun 2022 16:52:32 +0000 (11:52 -0500)
sect.c

diff --git a/sect.c b/sect.c
index b20542bbd172c554aa375c1bbb513724112ea3fe..20e6fcb4a32016685d68116e5024272eddcba10a 100644 (file)
--- a/sect.c
+++ b/sect.c
@@ -548,6 +548,9 @@ int ResolveFixups(int sno)
                                                // In this instruction the PC is located a DWORD away
                                                if (dw & FU_PCRELX)
                                                        eval += 2;
+                                               
+                                               if ((int64_t)eval > 0x7fff || (int64_t)eval < -32768)
+                                                       error(range_error);
                                        }
                                        else
                                        {