JPS6219937A - Checking system for propriety of argument - Google Patents

Checking system for propriety of argument

Info

Publication number
JPS6219937A
JPS6219937A JP60158515A JP15851585A JPS6219937A JP S6219937 A JPS6219937 A JP S6219937A JP 60158515 A JP60158515 A JP 60158515A JP 15851585 A JP15851585 A JP 15851585A JP S6219937 A JPS6219937 A JP S6219937A
Authority
JP
Japan
Prior art keywords
argument
subroutine
program
information table
attributes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP60158515A
Other languages
Japanese (ja)
Inventor
Yukimasa Yoshida
幸正 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP60158515A priority Critical patent/JPS6219937A/en
Publication of JPS6219937A publication Critical patent/JPS6219937A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To check propriety only to the argument which is used concretely in an execution mode by performing the comparison between the contents of both information tables when a subroutine is called out. CONSTITUTION:When a subroutine 2 is called out, a compiler produces an information table T1 related to the attribute of a argument group A1 to be delivered to the subroutine 2 from a program 1 within the desired program of the program 1. In the same way, an information table T2 related to the attribute of a dummy argument group A2 to be received from the program 1 is produced by the compiler within the desired program of the subroutine 2. The table T1 is read by calling out a routine R1 which reads the information table immediately before the subroutine 2 is called out by the program 1. Then a routine R2 is called out to check the information table immediately after the subroutine 2 is called out. Thus the table T2 is read newly and compared with the table T1 read precedingly. In such a way, the propriety is checked for attribute between a argument and a dummy.

Description

【発明の詳細な説明】 技術分野 本発明は引数の妥当性検査方式に関し、特にコンピュー
タプログラムにおけるコンパイラ言語によるプログラム
のサブルーチンの引数の属性の動的妥当性検査方式に関
する。
TECHNICAL FIELD The present invention relates to a method for validating arguments, and more particularly to a method for dynamically validating attributes of arguments of a subroutine of a computer program using a compiler language.

従来技術 従来、コンパイラ言語でプログラムがナブル−チンを呼
び出すとき、サブルーチンを呼び出すプログラムが渡す
引数の属性と、呼び出されるサブルーチンが受け取るべ
き仮引数の属性との間に矛盾がないかどうかの検査はロ
ードモジュール作成時にリンカによって行うか、又は引
数の属性の妥当性検査I11能を目的プログラムの中に
入れることで実現していた。
BACKGROUND ART Conventionally, when a program calls a routine in a compiler language, it is checked whether there is a conflict between the attributes of the argument passed by the program that calls the subroutine and the attributes of the formal argument that the called subroutine should receive. This has been accomplished either by using a linker when creating a module, or by incorporating the validity checking I11 function of argument attributes into the target program.

従来、引数の妥当性検査方法としてリンカで行う方法で
は、実行時に可変な属性の妥当性は検査できず一括して
処理”を行うのでリンク時に多量の主記憶を必要とする
とともに実行時には呼び出されないサブルーチンの引数
に対しても不必要な検査が行われる欠点がある。引数の
妥当性検査は能を目的プログラムの中に入れる方法では
コンパイラのコード生成が複雑になり、かつ目的プログ
ラムが冗長になる欠点がある。
Conventionally, the method of checking the validity of arguments using a linker cannot check the validity of variable attributes at runtime and processes them all at once, which requires a large amount of main memory at link time and is not called at runtime. The disadvantage is that unnecessary checks are performed even on arguments of subroutines that are not valid.If the argument validity checking function is included in the target program, the code generation by the compiler becomes complicated and the target program becomes redundant. There is a drawback.

発明の目的 本発明の目的は、上述した従来のものの欠点を解決して
コンパイラのコード生成にあまり負担がかからずかつ目
的プログラムが必要以上に大とならないようにした引数
の妥当性検査方式を提供することである。
OBJECTS OF THE INVENTION An object of the present invention is to provide an argument validity checking method that solves the above-mentioned drawbacks of the conventional methods and that does not place much burden on code generation by the compiler and does not make the target program unnecessarily large. It is to provide.

発明の構成 本発明による引数の妥当性検査方式は、サブルーチンを
呼び出すプログラムの目的プログラム中に、サブルーチ
ンに渡す引数の属性に関する情報テーブルを有する引数
の属性記憶手段と、呼び出されるサブルーチンの目的プ
ログラム中に、受け取るべき仮引数の属性に関する情報
テーブルを有する仮引数の属性記憶手段と画情報テーブ
ルを実行時に読み込んで比較検査し、矛盾がある場合に
指摘する検査手段とを含む構成である。
Structure of the Invention The argument validity checking method according to the present invention includes an argument attribute storage means having an information table regarding the attributes of the argument to be passed to the subroutine in the object program of the program that calls the subroutine, and an argument attribute storage means in the object program of the called subroutine. , a formal argument attribute storage means having an information table regarding the attributes of the formal argument to be received, and an inspection means for reading and comparing the image information table at the time of execution, and pointing out any discrepancies.

実施例 本発明を第1図に基づき説明する。Example The present invention will be explained based on FIG.

プログラム1は、サブルーチン2を呼び出ず。Program 1 does not call subroutine 2.

このとぎプログラム1がサブルーチン2に渡す引数群A
1の属性に関する情報テーブルT1がコンパイラにより
プログラム1の目的プログラム中に生成される。同様に
サブルーチン2の目的プログラム中にプログラム1から
受け取るべき仮引数群A2の属性に関する情報テーブル
T2がコンパイラにより生成される。実際に、プログラ
ム1がサブルーチン2を呼び出す直前に情報テーブルを
読み込むルーチンR1を呼び出すことによりテーブル1
が読み込まれる。
Argument group A that this cutting program 1 passes to subroutine 2
An information table T1 regarding attributes of program 1 is generated in the target program of program 1 by the compiler. Similarly, an information table T2 regarding the attributes of the formal argument group A2 to be received from the program 1 in the target program of the subroutine 2 is generated by the compiler. In fact, by calling routine R1 that reads the information table immediately before program 1 calls subroutine 2, table 1 is
is loaded.

次にサブルーチン2が呼ばれた直後に情報テーブルを検
査するルーチンR2を呼び出すことにより新たにテーブ
ルT2が読み込まれ、先に読み込まれたテーブルT1と
比較することで、引数と仮引数の属性の妥当性が検査さ
れる。この処理手順を第2図に示す。
Immediately after subroutine 2 is called, a new table T2 is read by calling routine R2 that checks the information table, and by comparing it with the previously read table T1, the validity of the attributes of the argument and formal argument is determined. Gender is tested. This processing procedure is shown in FIG.

第2図の手順100において、引数群A1に通常の処理
をしたあと手順300でサブルーチン2に制御を渡す前
に、手順200で情報テーブルを読み込むルーチンR1
を呼び出すことにより情報テーブルT1が読み込まれる
。次に手順300でサブルーチンに制御が渡ったあと、
手順310で情報テーブルを検査するルーチンR2が呼
び出される。手順310で呼び出される情報テーブルを
検査するルーチンR2の処理を第3図に示ザ。
In step 100 of FIG. 2, after performing normal processing on argument group A1, and before passing control to subroutine 2 in step 300, routine R1 reads an information table in step 200.
The information table T1 is read by calling . Next, after control is passed to the subroutine in step 300,
Routine R2 is called in step 310 to examine the information table. FIG. 3 shows the processing of routine R2 that checks the information table called in step 310.

第3図の引数を検査するルーチンR2では、まず手順3
11で情報テーブルT2が読み込まれる。
In the routine R2 that inspects the arguments in Figure 3, first step 3
11, the information table T2 is read.

次に手順312では先程第2図手順200で読み込まれ
た情報テーブルT1の内容と、この情報テーブルT2の
内容とが比較される。2つの情報テーブルの内容に矛盾
が無ければそのまま第2図の手順に戻り通常の処理を続
けるが、もし情報テーブルの内容に矛盾があった場合に
は、手順313によって引数群A1と仮引数群A2で何
番めの引数の属性がどのように矛盾しているのかを出力
し、引数間の属性に誤りがあることを表示してから第2
図の手順400に戻り、通常の処理を続行する。
Next, in step 312, the contents of the information table T1 previously read in step 200 of FIG. 2 are compared with the contents of this information table T2. If there is no contradiction between the contents of the two information tables, the process returns to the procedure shown in FIG. In A2, output how the attribute of the argument number is inconsistent, display that there is an error in the attribute between the arguments, and then output the second argument.
Returning to step 400 in the figure, normal processing continues.

発明の効果 以上述べたように本発明は、引数の妥当性を実行時に検
査するため、リンク時に行う方法の欠点を取り除き、実
行時に具体的に使われた引数に対してのみ、その妥当性
を検査できる利点を有する。
Effects of the Invention As described above, the present invention checks the validity of arguments at runtime, thereby eliminating the drawbacks of the method performed at link time and checking the validity only for arguments specifically used at runtime. It has the advantage of being able to be inspected.

また目的プログラム中には引数の情報テーブルと、情報
テーブルを読み込むルーチンを呼び出すコード及び情報
テーブルを検査するルーチンを呼び出すコードを入れる
だけなので、コンパイラのコード生成にあまり負担がか
からず、かつ目的プログラムが必要以上に大ぎくならな
いという利点もある。更に、引数の妥当性の誤りを検出
した後の処理ルーチンが集中化されており、誤りの表示
の制御や、誤りを無視して処理を続行するかどうかの制
御など、誤りを検出した後の処理を容易に拡張。
In addition, since the target program only includes the argument information table, the code that calls the routine that reads the information table, and the code that calls the routine that inspects the information table, it does not put much burden on the compiler's code generation, and the target program It also has the advantage that it does not become unnecessarily large. Furthermore, the processing routines after detecting an argument validity error are centralized, including controlling the display of the error and whether to ignore the error and continue processing. Easily scale processing.

変更できるという利点を有するものである。It has the advantage of being changeable.

【図面の簡単な説明】 第1図は本発明の実施例の全体の構成図、第2図及び第
3図は本発明の実施例の処理方法のフローチャートであ
る。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is an overall configuration diagram of an embodiment of the present invention, and FIGS. 2 and 3 are flowcharts of a processing method of the embodiment of the present invention.

Claims (1)

【特許請求の範囲】[Claims] プログラムがサブルーチンを呼び出す際に、前記サブル
ーチンに渡す引数の属性と前記サブルーチンが受け取る
べき仮引数の属性との間の妥当性を検査する引数の妥当
性検査方式であつて、前記サブルーチンに渡す引数の属
性に関する情報テーブルを格納する引数属性記憶手段と
、前記サブルーチンが受け取るべき仮引数の属性に関す
る情報テーブルを格納する仮引数属性記憶手段と、前記
両情報テーブルの内容を比較する比較手段とを設け、前
記サブルーチンの呼び出しの際に前記両情報テーブルの
内容を比較手段により比較検査するようにしたことを特
徴とする引数の妥当性検査方式。
When a program calls a subroutine, an argument validation method that checks the validity between the attributes of the argument passed to the subroutine and the attributes of the formal argument that the subroutine should receive, the method comprising: Argument attribute storage means for storing an information table regarding attributes, formal argument attribute storage means for storing an information table regarding attributes of formal arguments to be received by the subroutine, and comparison means for comparing the contents of both the information tables, An argument validity checking method, characterized in that when the subroutine is called, the contents of both the information tables are compared and checked by a comparing means.
JP60158515A 1985-07-18 1985-07-18 Checking system for propriety of argument Pending JPS6219937A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60158515A JPS6219937A (en) 1985-07-18 1985-07-18 Checking system for propriety of argument

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60158515A JPS6219937A (en) 1985-07-18 1985-07-18 Checking system for propriety of argument

Publications (1)

Publication Number Publication Date
JPS6219937A true JPS6219937A (en) 1987-01-28

Family

ID=15673422

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60158515A Pending JPS6219937A (en) 1985-07-18 1985-07-18 Checking system for propriety of argument

Country Status (1)

Country Link
JP (1) JPS6219937A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4732651B2 (en) * 1999-09-20 2011-07-27 ギーゼッケ ウント デフリエント ゲーエムベーハー Methods for protecting program execution

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57113149A (en) * 1980-12-29 1982-07-14 Fujitsu Ltd Interprogram control system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57113149A (en) * 1980-12-29 1982-07-14 Fujitsu Ltd Interprogram control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4732651B2 (en) * 1999-09-20 2011-07-27 ギーゼッケ ウント デフリエント ゲーエムベーハー Methods for protecting program execution

Similar Documents

Publication Publication Date Title
US5651111A (en) Method and apparatus for producing a software test system using complementary code to resolve external dependencies
CN111104335B (en) C language defect detection method and device based on multi-level analysis
US8042099B2 (en) Facilitating availability of object data types at runtime
CN111722863A (en) Method and device for updating wind control model
JPS6219937A (en) Checking system for propriety of argument
US20080155511A1 (en) System and method for detecting events in computer code using interval values simulation
JPH0736734A (en) Method for checking argument value
JPH01177165A (en) Definition-quotation relation checking system for array
CN111176968B (en) Method and device for generating log file and related products
CN117908899A (en) Code checking method, system, electronic device and computer readable storage medium
Plessel Design By Contract: A Missing Link In The Quest For Quality Software
JPS5829053A (en) Program correction controlling method with interruption
JP2533532B2 (en) Online test method
JPH01155438A (en) Compiler test system
CN117743150A (en) Testing method and device for parallel execution of steps, electronic equipment and medium
CN117785716A (en) Complex software source code verification method based on model detection
CN118113291A (en) Memory security management method and equipment
CN116860626A (en) Static analyzer testing method and device
JPH10177484A (en) Argument checking device
CN115080439A (en) Independent assertion testing method, device, apparatus, storage medium, and program product
CN115185844A (en) Method and device for testing application program
CN117271326A (en) Data migration testing method, device, equipment and medium
JPS60120446A (en) Control system of program test
JPH05100898A (en) Program debugging system
JPH03233742A (en) Data check system