Skip to content

C++: codeql seemingly returning wrong Expr �?#4223

@hugeh0ge

Description

@hugeh0ge

See the following C++ and codeql code:

#include <cstdio>

struct Test {
  const char * operator()() const {
    return "Hello, World!";
  }
};

void f(Test st) {
  puts(st());
}

int main() {
  f(Test());
}
from Function func, FunctionCall fc
where func.getName().matches("f")
  and fc.getTarget() = func
select fc, fc.getArgument(0)

When I query the C++ code, codeql says the argument of FunctionCall is 0 instead of an instance of struct Test.
Is this a bug? Or some intended behavior?

Metadata

Metadata

Assignees

Labels

C++questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions