Browse Source

* RiscV32: properly read references with record offsets and base register
+ RiscV32: sanity check in assembler writer

git-svn-id: trunk@48892 -

florian 4 years ago
parent
commit
6f3fccddd1
2 changed files with 7 additions and 2 deletions
  1. 3 1
      compiler/riscv/agrvgas.pas
  2. 4 1
      compiler/riscv32/rarv32gas.pas

+ 3 - 1
compiler/riscv/agrvgas.pas

@@ -130,7 +130,9 @@ unit agrvgas;
                  s:=s+gas_regname(base)+','+gas_regname(index)
                else
                  internalerror(2006052502);
-             end;
+             end
+           else
+             Internalerror(2021030602);
 
            case refaddr of
              addr_lo12: s:='%lo'+s;

+ 4 - 1
compiler/riscv32/rarv32gas.pas

@@ -533,7 +533,10 @@ Unit rarv32gas;
                end;
               { Do we have a indexing reference, then parse it also }
               if actasmtoken=AS_LPAREN then
-                BuildReference(oper);
+                begin
+                  oper.InitRef;
+                  BuildReference(oper);
+                end;
             end;
 
           AS_REGISTER: { Register, a variable reference or a constant reference  }