[C++] data flow node not found
g++ version: 4.8.2 codeql version: 2.23.6
main.cpp:
#include "stdint.h"
#include <string>
class Test {
public:
explicit Test(const uint64_t &id) : id_(id) {}
private:
uint64_t id_;
};
int main(int argc, char* argv[]){
Test test(123456);
return 0;
}
create database command:
codeql database create testdb --language=cpp --command='g++ main.cpp -std=c++11' -j 0
query:
from DataFlow::Node n
where n.getLocation().getFile().getBaseName() = "main.cpp"
select n
I can find the data flow node "*constructor init of field id_":
and then i add a string member variable str_ like this(line 9):
#include "stdint.h"
#include <string>
class Test {
public:
explicit Test(const uint64_t &id) : id_(id) {}
private:
std::string str_{};
uint64_t id_;
};
int main(int argc, char* argv[]){
Test test(123456);
return 0;
}
use the same command to create a new database and the same query to analyze, it seems that i can not find the data flow node "*constructor init of field id_" in the new database.
C:>psexec -i -s cmd.exe
At the new prompt cmd.exe
net use z: \192.168.0.5\temp /user:USER-PC\user 123 /persistent:yes
and add a script (net use z: \192.168.0.5\temp /user:USER-PC\user 123) to run at startup.
Okay nice 🙂🎉🎉✌️
g++ version: 4.8.2 codeql version: 2.23.6
main.cpp:
#include "stdint.h" #include <string> class Test { public: explicit Test(const uint64_t &id) : id_(id) {} private: uint64_t id_; }; int main(int argc, char* argv[]){ Test test(123456); return 0; }create database command:
codeql database create testdb --language=cpp --command='g++ main.cpp -std=c++11' -j 0query:
from DataFlow::Node n where n.getLocation().getFile().getBaseName() = "main.cpp" select nI can find the data flow node "*constructor init of field id_":
![]()
and then i add a string member variable str_ like this(line 9):
#include "stdint.h" #include <string> class Test { public: explicit Test(const uint64_t &id) : id_(id) {} private: std::string str_{}; uint64_t id_; }; int main(int argc, char* argv[]){ Test test(123456); return 0; }use the same command to create a new database and the same query to analyze, it seems that i can not find the data flow node "*constructor init of field id_" in the new database.
Hi @hello123leo 👋🏻
I have been able to confirm this behaviour. I'll check with the relevant team to see whether this is a bug or somehow intentional.
Hi again @hello123leo,
I have checked with the team and they can confirm that this is a bug. They will look at getting this fixed, but we can't currently provide a timeline for when a fix might be ready. We will post an update here when there is one.
Thanks @mbg . Looking forward to a fix.