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

* users can use the internalproc directive in their code, so throw a proper error if the supplied number is not known, resolves #41310

florian 1 месяц назад
Родитель
Сommit
e1b6a8f192
3 измененных файлов с 12 добавлено и 1 удалено
  1. 3 0
      compiler/msg/errore.msg
  2. 2 1
      compiler/ninl.pas
  3. 7 0
      tests/webtbs/tw41310.pp

+ 3 - 0
compiler/msg/errore.msg

@@ -2691,6 +2691,9 @@ cg_w_interrupt_does_not_save_registers=06062_W_The target CPU does not support p
 % Certain processors have no memory (e.~g. avr1 family), so they do not support storing/restoring the used registers
 % in an interrupt routine. The programmer has to ensure that while there is a chance for the interrupt routine being
 % called that no other code depending on registers being preserved is executed.
+cg_f_unknown_internal_procedure_number=06063_F_Unknown internal procedure number "$1"
+% The directive \var{internproc} is used with a number not known by the compiler. \var{internproc} should be used only by the
+% supplied RTL or by users really knowing what they are doing.
 %
 % \end{description}
 # EndOfTeX

+ 2 - 1
compiler/ninl.pas

@@ -4328,7 +4328,8 @@ implementation
     function tinlinenode.pass_typecheck_cpu : tnode;
       begin
         Result:=nil;
-        internalerror(2017110102);
+
+        Message1(cg_f_unknown_internal_procedure_number,tostr(ord(inlinenumber)));
       end;
 
 

+ 7 - 0
tests/webtbs/tw41310.pp

@@ -0,0 +1,7 @@
+program ie2017110102;
+
+procedure f; [internproc: 0];
+
+begin
+  f; // Error: Internal error 2017110102
+end.