Ver código fonte

* do not throw an internal error on illegal assembler expressions, resolves #37439

git-svn-id: trunk@46499 -
florian 5 anos atrás
pai
commit
120825d1d6
3 arquivos alterados com 22 adições e 16 exclusões
  1. 1 0
      .gitattributes
  2. 17 16
      compiler/x86/rax86att.pas
  3. 4 0
      tests/webtbf/tw37459.pp

+ 1 - 0
.gitattributes

@@ -16556,6 +16556,7 @@ tests/webtbf/tw37272b.pp svneol=native#text/pascal
 tests/webtbf/tw37303.pp -text svneol=native#text/pascal
 tests/webtbf/tw3738.pp svneol=native#text/plain
 tests/webtbf/tw3740.pp svneol=native#text/plain
+tests/webtbf/tw37459.pp svneol=native#text/pascal
 tests/webtbf/tw37460.pp svneol=native#text/pascal
 tests/webtbf/tw37462.pp svneol=native#text/pascal
 tests/webtbf/tw37475.pp svneol=native#text/pascal

+ 17 - 16
compiler/x86/rax86att.pas

@@ -720,22 +720,23 @@ Implementation
                       if (actasmtoken=AS_PLUS) then
                         begin
                           l:=BuildConstExpression(true,false);
-                          case oper.opr.typ of
-                            OPR_CONSTANT :
-                              inc(oper.opr.val,l);
-                            OPR_LOCAL :
-                              begin
-                                inc(oper.opr.localsymofs,l);
-                                inc(oper.opr.localconstoffset, l);
-                              end;
-                            OPR_REFERENCE :
-                              begin
-                                inc(oper.opr.ref.offset,l);
-                                inc(oper.opr.constoffset, l);
-                              end;
-                            else
-                              internalerror(200309202);
-                          end;
+                          if errorcount=0 then
+                            case oper.opr.typ of
+                              OPR_CONSTANT :
+                                inc(oper.opr.val,l);
+                              OPR_LOCAL :
+                                begin
+                                  inc(oper.opr.localsymofs,l);
+                                  inc(oper.opr.localconstoffset, l);
+                                end;
+                              OPR_REFERENCE :
+                                begin
+                                  inc(oper.opr.ref.offset,l);
+                                  inc(oper.opr.constoffset, l);
+                                end;
+                              else
+                                internalerror(200309202);
+                            end;
                         end;
                     end;
                end;

+ 4 - 0
tests/webtbf/tw37459.pp

@@ -0,0 +1,4 @@
+{ %fail }
+begin
+  asm test ptr + ,
+// end.