Просмотр исходного кода

* fixed uninitialized TJasminAssembler.ConstAssignmentValue() function result

git-svn-id: trunk@22126 -
Jonas Maebe 13 лет назад
Родитель
Сommit
b6db767ac4
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      compiler/agjasmin.pas

+ 3 - 3
compiler/agjasmin.pas

@@ -796,22 +796,22 @@ implementation
 
 
     function TJasminAssembler.ConstAssignmentValue(csym: tconstsym): ansistring;
     function TJasminAssembler.ConstAssignmentValue(csym: tconstsym): ansistring;
       begin
       begin
+        result:='';
         { nil is the default value -> don't write explicitly }
         { nil is the default value -> don't write explicitly }
         case csym.consttyp of
         case csym.consttyp of
           constpointer:
           constpointer:
             begin
             begin
               if csym.value.valueordptr<>0 then
               if csym.value.valueordptr<>0 then
                 internalerror(2011021206);
                 internalerror(2011021206);
-              result:='';
             end;
             end;
           constnil:
           constnil:
-            result:='';
+            ;
         else
         else
           begin
           begin
             { enums and sets are initialized as typed constants }
             { enums and sets are initialized as typed constants }
             if not assigned(csym.constdef) or
             if not assigned(csym.constdef) or
                not(csym.constdef.typ in [enumdef,setdef]) then
                not(csym.constdef.typ in [enumdef,setdef]) then
-              result:=' = '+ConstValue(csym)
+              result:=' = '+ConstValue(csym);
           end;
           end;
         end;
         end;
       end;
       end;