Explorar o código

* 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 %!s(int64=10) %!d(string=hai) anos
pai
achega
2c3aa7cee0
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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 }