File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1131,7 +1131,15 @@ ASTGateNode::ASTGateNode(const ASTIdentifierNode *Id,
1131
1131
++C;
1132
1132
}
1133
1133
1134
- assert (C == Params.size () && " Inconsistent number of Params!" );
1134
+ if (C != Params.size ()) {
1135
+ std::stringstream M;
1136
+ M << C
1137
+ << " inconsistent parameters in the gate call for the "
1138
+ " corresponding gate definition" ;
1139
+ QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
1140
+ DIAGLineCounter::Instance ().GetLocation (), M.str (), DiagLevel::Error);
1141
+ return ;
1142
+ }
1135
1143
1136
1144
C = 0 ;
1137
1145
Ty = ASTTypeUndefined;
@@ -1363,7 +1371,15 @@ ASTGateNode::ASTGateNode(const ASTIdentifierNode *Id,
1363
1371
++C;
1364
1372
}
1365
1373
1366
- assert (C == Params.size () && " Inconsistent number of Params!" );
1374
+ if (C != Params.size ()) {
1375
+ std::stringstream M;
1376
+ M << C
1377
+ << " inconsistent parameters in the gate call for the "
1378
+ " corresponding gate definition" ;
1379
+ QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
1380
+ DIAGLineCounter::Instance ().GetLocation (), M.str (), DiagLevel::Error);
1381
+ return ;
1382
+ }
1367
1383
1368
1384
for (std::vector<ASTAngleNode *>::const_iterator I = Params.begin ();
1369
1385
I != Params.end (); ++I) {
You can’t perform that action at this time.
0 commit comments