diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-11-02 20:29:53 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2023-01-08 02:24:39 +0000 |
commit | b37f24b7e27a77c398f41cc331608aff806f0d42 (patch) | |
tree | 0c47a5f9e1ce348fd2817ad2d391dc88b32c7001 /tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page | |
parent | 41feafa85d73b4a9dd8eac9dbe1231130bf2c7ca (diff) | |
download | gobject-introspection-b37f24b7e27a77c398f41cc331608aff806f0d42.tar.gz |
scanner: don't accept invalid symbols in binary expressions
The rules for binary expressions were entirely oblivious to the type of
the operand symbols and assumed they're integer constants.
This is very unfortunate, since it caused all sort of nonsense to end up
getting accepted. One such example is the following define from
NetworkManager's libnm:
#define NM_SETTING_PARAM_SECRET (1 << (2 + G_PARAM_USER_SHIFT))
As G_PARAM_USER_SHIFT is unknown, it was parsed as an invalid symbol.
The addition didn't care, treated it as:
#define NM_SETTING_PARAM_SECRET (1 << (2 + 0))
Let's just ensure we get CSYMBOL_TYPE_CONST only when both operands
actually have const_int_set. Otherwise just create CSYMBOL_TYPE_INVALID.
That will cause the symbol to be dropped on the floor eventually, but
that's probably much better than a having an invalid value.
Diffstat (limited to 'tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page')
-rw-r--r-- | tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page b/tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page deleted file mode 100644 index bc8190a8..00000000 --- a/tests/scanner/Regress-1.0-Python-expected/Regress.BAD_EXPR_CONSTANT.page +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<page id="Regress.BAD_EXPR_CONSTANT" - type="topic" - style="default" - xmlns="http://projectmallard.org/1.0/" - xmlns:api="http://projectmallard.org/experimental/api/" - xmlns:ui="http://projectmallard.org/1.0/ui/"> - <info> - <link xref="index" group="default" type="guide"/> - </info> - <title>Regress.BAD_EXPR_CONSTANT</title> - - -</page> |