about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--036labels.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/036labels.cc b/036labels.cc
index c269538a..dbecef7e 100644
--- a/036labels.cc
+++ b/036labels.cc
@@ -223,6 +223,9 @@ void replace_labels_with_displacements(segment& code, const map<string, int32_t>
     for (int j = 0;  j < SIZE(inst.words);  ++j) {
       const word& curr = inst.words.at(j);
       if (contains_key(byte_index, curr.data)) {
+        if (has_argument_metadata(inst, "mod")) {
+          raise << "'" << to_string(inst) << "' don't pass references to labels around like data\n" << end();
+        }
         int32_t displacement = static_cast<int32_t>(get(byte_index, curr.data)) - byte_index_next_instruction_starts_at;
         if (has_argument_metadata(curr, "disp8")) {
           if (displacement > 0x7f || displacement < -0x7f)