summaryrefslogtreecommitdiff
path: root/compiler/pdecsub.pas
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/pdecsub.pas')
-rw-r--r--compiler/pdecsub.pas14
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas
index eed0ac4640..1110c19f59 100644
--- a/compiler/pdecsub.pas
+++ b/compiler/pdecsub.pas
@@ -2183,8 +2183,18 @@ begin
if target_info.system = system_m68k_palmos then
begin
v:=get_intconst;
- tprocdef(pd).import_nr:=longint(v.svalue);
- tprocdef(pd).extnumber:=15;
+ tprocdef(pd).extnumber:=longint(v.svalue);
+ if ((v<0) or (v>high(word))) then
+ message(parser_e_range_check_error);
+
+ if try_to_consume(_COMMA) then
+ begin
+ v:=get_intconst;
+ if ((v<0) or (v>high(word))) then
+ message(parser_e_range_check_error);
+ tprocdef(pd).import_nr:=longint(v.svalue);
+ include(pd.procoptions,po_syscall_has_importnr);
+ end;
exit;
end;