Browse Source

* do not throw an error if syscall is used with a syntax not applicable for the current
target, resolves #39640

florian 3 years ago
parent
commit
4718029fe0
5 changed files with 398 additions and 384 deletions
  1. 4 1
      compiler/msg/errore.msg
  2. 3 2
      compiler/msgidx.inc
  3. 379 380
      compiler/msgtxt.inc
  4. 1 1
      compiler/pdecsub.pas
  5. 11 0
      tests/webtbf/tw39640.pp

+ 4 - 1
compiler/msg/errore.msg

@@ -445,7 +445,7 @@ scan_e_unexpected_endif=02108_E_$ENDIF directive found without a matching $IF(N)
 #
 # Parser
 #
-# 03363 is the last used one
+# 03364 is the last used one
 #
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
@@ -1638,6 +1638,9 @@ parser_e_raise_with_noreturn_not_allowed=03361_E_Raise in subroutines declared a
 parser_e_section_directive_not_allowed_for_target=03362_E_Directive section not allowed for this target
 % Only some targets (e.g. Embedded and FreeRTOS) support the section directive.
 parser_e_absolute_sym_cannot_reference_itself=03363_E_Absolute variable cannot reference itself
+parser_e_syscall_format_not_support=03364_E_Syntax of syscall directive not supported by current target
+% On a certain target, not all syntax variants of the syscall directive make sense and thus those making
+% no sense are not supported
 % Declarations like \var{var i: Integer absolute i;} are not allowed
 %
 % \end{description}

+ 3 - 2
compiler/msgidx.inc

@@ -477,6 +477,7 @@ const
   parser_e_raise_with_noreturn_not_allowed=03361;
   parser_e_section_directive_not_allowed_for_target=03362;
   parser_e_absolute_sym_cannot_reference_itself=03363;
+  parser_e_syscall_format_not_support=03364;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
@@ -1150,9 +1151,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 89451;
+  MsgTxtSize = 89519;
 
   MsgIdxMax : array[1..20] of longint=(
-    28,109,364,131,99,63,148,37,223,69,
+    28,109,365,131,99,63,148,37,223,69,
     65,20,30,1,1,1,1,1,1,1
   );

File diff suppressed because it is too large
+ 379 - 380
compiler/msgtxt.inc


+ 1 - 1
compiler/pdecsub.pas

@@ -2171,7 +2171,7 @@ procedure pd_syscall(pd:tabstractprocdef);
                   include(pd.procoptions,get_default_syscall);
               end;
           else
-            internalerror(2019050526);
+            Message(parser_e_syscall_format_not_support);
         end;
       end;
 

+ 11 - 0
tests/webtbf/tw39640.pp

@@ -0,0 +1,11 @@
+{ %fail }
+{ %target=linux,win32,win64,embedded,freebsd,darwin }
+program test;
+var
+  execBase: pointer;
+
+  procedure test_a_syscall; syscall execBase 6;
+
+begin
+  writeln('syscall test');
+end.

Some files were not shown because too many files changed in this diff