Sfoglia il codice sorgente

* give an internal error in second_int_to_bool() if left.expectloc was not
in [LOC_FLAGS,LOC_JUMP], but it's actual location is one of those

git-svn-id: trunk@29587 -

Jonas Maebe 10 anni fa
parent
commit
2c3aa7cee0
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      compiler/ncgcnv.pas

+ 5 - 0
compiler/ncgcnv.pas

@@ -176,6 +176,11 @@ interface
         if (nf_explicit in flags) and
            not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
           begin
+             { overriding methods must be able to know in advance whether this
+               code path will be taken by checking expectloc, so they can call
+               the inherited method in that case }
+             if left.expectloc in [LOC_FLAGS,LOC_JUMP] then
+               internalerror(2014122901);
              location_copy(location,left.location);
              newsize:=def_cgsize(resultdef);
              { change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }