Explorar o código

* the stack pointer on Risc-V points always at the last used position, resolves #39739

florian %!s(int64=3) %!d(string=hai) anos
pai
achega
1c7626715d
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      compiler/systems/t_embed.pas
  2. 1 1
      compiler/systems/t_freertos.pas

+ 1 - 1
compiler/systems/t_embed.pas

@@ -1400,7 +1400,7 @@ begin
           Add('  flash      (rx)   : ORIGIN = 0x'+IntToHex(flashbase,6)+', LENGTH = 0x'+IntToHex(flashsize,6));
           Add('  ram        (rw!x) : ORIGIN = 0x'+IntToHex(srambase,6)+', LENGTH = 0x'+IntToHex(sramsize,6));
           Add('}');
-          Add('_stack_top = 0x' + IntToHex(srambase+sramsize-1,4) + ';');
+          Add('_stack_top = 0x' + IntToHex(srambase+sramsize,4) + ';');
         end;
       Add('SECTIONS');
       Add('{');

+ 1 - 1
compiler/systems/t_freertos.pas

@@ -830,7 +830,7 @@ begin
           Add('  flash      (rx)   : ORIGIN = 0x'+IntToHex(flashbase,6)+', LENGTH = 0x'+IntToHex(flashsize,6));
           Add('  ram        (rw!x) : ORIGIN = 0x'+IntToHex(srambase,6)+', LENGTH = 0x'+IntToHex(sramsize,6));
           Add('}');
-          Add('_stack_top = 0x' + IntToHex(srambase+sramsize-1,4) + ';');
+          Add('_stack_top = 0x' + IntToHex(srambase+sramsize,4) + ';');
         end;
       Add('SECTIONS');
       Add('{');