Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nocheck prefix #81615

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/coreclr/ilasm/asmparse.y
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
%token P_DEFINE P_UNDEF P_IFDEF P_IFNDEF P_ELSE P_ENDIF P_INCLUDE

/* newly added tokens go here */
%token CONSTRAINT_
%token CONSTRAINT_ TYPECHECK_ RANGECHECK_ NULLCHECK_

/* nonTerminals */
%type <string> dottedName id methodName atOpt slashedName
Expand All @@ -150,6 +150,7 @@
%type <int32> iidParamIndex genArity genArityNotEmpty
%type <float64> float64
%type <int64> int64
%type <int32> noCheckOptGroup noCheckOpt
%type <binstr> sigArgs0 sigArgs1 sigArg type bound bounds1 bytes hexbytes nativeType marshalBlob initOpt compQstring caValue
%type <binstr> marshalClause
%type <binstr> fieldInit serInit fieldSerInit
Expand Down Expand Up @@ -271,6 +272,15 @@ float64 : FLOAT64 { $$ = $1; }
| FLOAT64_ '(' int64 ')' { $$ = (double*) $3; }
;

noCheckOpt : TYPECHECK_ { $$ = 0x01; }
| RANGECHECK_ { $$ = 0x02; }
| NULLCHECK_ { $$ = 0x04; }
;

noCheckOptGroup : noCheckOpt { $$ = $1; }
| noCheckOpt noCheckOptGroup { $$ = $1 | $2; }
;

/* Aliasing of types, type specs, methods, fields and custom attributes */
typedefDecl : _TYPEDEF type AS_ dottedName { PASM->AddTypeDef($2,$4); }
| _TYPEDEF className AS_ dottedName { PASM->AddTypeDef($2,$4); }
Expand Down Expand Up @@ -1368,6 +1378,7 @@ instr : instr_none { PASM->EmitOpcode(
| instr_var int32 { PASM->EmitInstrVar($1, $2); }
| instr_var id { PASM->EmitInstrVarByName($1, $2); }
| instr_i int32 { PASM->EmitInstrI($1, $2); }
| instr_i noCheckOptGroup { PASM->EmitInstrI($1, $2); }
| instr_i8 int64 { PASM->EmitInstrI8($1, $2); }
| instr_r float64 { PASM->EmitInstrR($1, $2); delete ($2);}
| instr_r int64 { double f = (double) (*$2); PASM->EmitInstrR($1, &f); }
Expand Down
Loading