Skip to content

Commit

Permalink
Remove double check_nargs call
Browse files Browse the repository at this point in the history
This causes double lines in the error output:
```
bpftrace -e 'BEGIN{ @=1 } i:ms:1 { zero(@,1); }'
zero() should take 1 arguments (2 provided)
zero() should take 1 arguments (2 provided)
```
  • Loading branch information
fbs authored and danobi committed Jun 5, 2019
1 parent 41036b9 commit c226c10
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/ast/semantic_analyser.cpp
Expand Up @@ -460,7 +460,6 @@ void SemanticAnalyser::visit(Call &call)
}
else if (call.func == "clear") {
check_assignment(call, false, false);
check_nargs(call, 1);
if (check_nargs(call, 1)) {
auto &arg = *call.vargs->at(0);
if (!arg.is_map)
Expand All @@ -477,7 +476,6 @@ void SemanticAnalyser::visit(Call &call)
}
else if (call.func == "zero") {
check_assignment(call, false, false);
check_nargs(call, 1);
if (check_nargs(call, 1)) {
auto &arg = *call.vargs->at(0);
if (!arg.is_map)
Expand Down

0 comments on commit c226c10

Please sign in to comment.