From 00272c954ced5a20c2ea9452ac3d9b4a67dc01c1 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Thu, 7 Apr 2011 15:02:54 +0900 Subject: [PATCH] =?utf8?q?=E5=85=A5=E5=87=BA=E5=8A=9B=E6=99=82=E3=81=AE?= =?utf8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E6=9D=A1=E4=BB=B6=E3=82=92=E5=A4=89?= =?utf8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 入出力領域がメモリ容量を越えた場合にエラーとしていたのを、 プログラム領域を越えた場合にエラーとするよう変更 --- include/struct.h | 2 +- src/exec.c | 4 ++-- test/system/casl2/err_209/0.txt | 2 +- test/system/comet2/err_209/0.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/struct.h b/include/struct.h index 6a5a0e4..88ecda9 100644 --- a/include/struct.h +++ b/include/struct.h @@ -91,7 +91,7 @@ typedef struct { char *name; /**<命令名 */ CMDTYPE type; /**<命令タイプ */ WORD code; /**<命令コード */ - const void (*ptr); /**<命令の関数ポインタ */ + const void (*ptr); /**<命令の関数ポインタ */ } CMD; /** diff --git a/src/exec.c b/src/exec.c index 61faee3..3fb2771 100644 --- a/src/exec.c +++ b/src/exec.c @@ -99,7 +99,7 @@ void svcin() --i; break; } - if(sys->cpu->gr[1] + i >= sys->memsize - 1) { + if(sys->cpu->gr[1] + i > execptr->end) { setcerr(208, NULL); /* SVC input - memory overflow */ break; } @@ -118,7 +118,7 @@ void svcout() WORD w; for(i = 0; i < sys->memory[sys->cpu->gr[2]]; i++) { - if(sys->cpu->gr[1] + i >= sys->memsize - 1) { + if(sys->cpu->gr[1] + i > execptr->end) { setcerr(209, NULL); /* SVC output - memory overflow */ return; } diff --git a/test/system/casl2/err_209/0.txt b/test/system/casl2/err_209/0.txt index 4a8bc44..6f1974a 100644 --- a/test/system/casl2/err_209/0.txt +++ b/test/system/casl2/err_209/0.txt @@ -6,4 +6,4 @@ BUF DC ' !' LEN DC 60 END !< -........Execute error - 209: SVC output - memory overflow +..Execute error - 209: SVC output - memory overflow diff --git a/test/system/comet2/err_209/0.txt b/test/system/comet2/err_209/0.txt index 7d15bf3..f7d3df1 100644 --- a/test/system/comet2/err_209/0.txt +++ b/test/system/comet2/err_209/0.txt @@ -1,2 +1,2 @@ !< -........Execute error - 209: SVC output - memory overflow +..Execute error - 209: SVC output - memory overflow -- 2.18.0