-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
IRGuardCondition failure to detect NULL condition #15186
Comments
Hi @tardigrade-9, Which version of CodeQL are you running? This looks like something we fixed recently. |
Hi @jketema , I'm using CodeQL CLI v2.15.4 |
Do you work with a cloned copy of the CodeQL repository? If so, what commit are you on? |
I don't work from cloned copy, I installed using brew and I also use VS Code extension. I tried on v2.15.5 now, the results are still same. Do you want me try from source code build? I also see that 2.15.5 is the latest version. |
That shouldn't make a difference. I'll investigate. |
From the looks of this, you might be using an older version of the Can you check in your You can force downloading the latest version by running |
Thanks @aeisenberg for the suggestion. I did the upgrade to "0.12.2", but the result is still the same. I also tried removing the compile-cache folder, but it did not work too..
|
UPDATE: I think my vscode-codeql-starter workspace has issue. I tried running the query from a fresh directory , and it worked. Any help to fix the issue with current workspace would be great. Thanks |
Ah...yes. That is correct. The starter workspace clones all of the queries in a submodule. I forgot to ask about that. To get the latest queries, just go to the |
Thanks @aeisenberg for the help.. I can see the results in vscode after submodule update.
Since the IRGuardCondition is unary instruction, I feel this must be modified. I don't see any result for the above query. |
I'm not able to download a C/C++ database for the https://github.com/xkbcommon/libxkbcommon/ project, so I can't test it on the "real thing". However, when I run your struct xkb_compose_table;
struct FILE;
enum xkb_compose_format
{
XKB_COMPOSE_FORMAT_TEXT_V1 = 1
};
enum xkb_compose_compile_flags
{
XKB_COMPOSE_COMPILE_NO_FLAGS = 0
};
struct xkb_compose_table *xkb_compose_table_new(struct xkb_context *ctx,
const char *locale,
enum xkb_compose_format format,
enum xkb_compose_compile_flags flags);
bool parse_file(struct xkb_compose_table *table, FILE *file, const char *filename);
void xkb_compose_table_unref(struct xkb_compose_table *table);
void log_err_func(struct xkb_context *ctx, const char *fmt, ...);
struct xkb_compose_table *xkb_compose_table_new_from_file(struct xkb_context *ctx,
FILE *file,
const char *locale,
enum xkb_compose_format format,
enum xkb_compose_compile_flags flags)
{
struct xkb_compose_table *table;
bool ok;
if (flags & ~(XKB_COMPOSE_COMPILE_NO_FLAGS))
{
log_err_func(ctx, "unrecognized flags: %#x\n", flags);
return nullptr;
}
if (format != XKB_COMPOSE_FORMAT_TEXT_V1)
{
log_err_func(ctx, "unsupported compose format: %d\n", format);
return nullptr;
}
table = xkb_compose_table_new(ctx, locale, format, flags);
if (!table)
return nullptr;
ok = parse_file(table, file, "(unknown file)");
if (!ok)
{
xkb_compose_table_unref(table);
return nullptr;
}
return table;
} I get 3 results:
where:
So I certainly get results from the query. It sounds like you're not getting any results? I'm not sure why that's the case. I also don't follow what you mean by:
|
@MathiasVP Can you share the database containing the code snippet please? Also you should get 5 results, |
I wrote a small query to understand all the IRGuardConditions inside a function
Below is snippet of my custom function func2(...)
Below is a function named xkb_compose_table_new_from_file from libxkbcommon
The results for func2 are as expected. I see
CompareNE
andCompareGT
While for libxkbcommon, I see
Load: table
andLoad: ok
as IRGuardCondition rather thanCompareNE: (bool)...
Any reason for this discrepancy?
Due to this issue, the predicate below is unable to detect NULL check
The text was updated successfully, but these errors were encountered: