aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-11-19 16:43:55 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-11-20 21:28:42 +0100
commit0eb8175d3e9c0d20354763d07ce3d4c0e543d988 (patch)
tree6cce0cea812e635a661a7af612b74659cd503a38 /validation
parentaf0c939354599110285978dbeb2cbb65acc537be (diff)
downloadsparse-dev-0eb8175d3e9c0d20354763d07ce3d4c0e543d988.tar.gz
fix expansion of function designator
The expression corresponding to the function pointer of indirect call can be arbirarily complex. For example, it can contain a statement expression or another call, possibly inlined. These expressions must be expanded to insure that sub-expressions involving 'sizeof()' or other operators taking a type as argument (like __builtin_compatible_types_p()) are no more present (because these expressions always evaluate to a compile-time constant and so are not expected and thus not handled at linearization time). However, this is not currently enforced, possibly causing some failures during linearization with warnings like: warning: unknown expression (4 0) (which correspond to EXPR_TYPE). Fix this, during the expansion of function calls, by also expanding the corresponding designator. References: https://lore.kernel.org/lkml/1542623503-3755-1-git-send-email-yamada.masahiro@socionext.com/ Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/expand/function-pointer.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/expand/function-pointer.c b/validation/expand/function-pointer.c
index 45aace16..706ef9a4 100644
--- a/validation/expand/function-pointer.c
+++ b/validation/expand/function-pointer.c
@@ -16,7 +16,6 @@ static void tst(struct s *s)
/*
* check-name: function-pointer
* check-command: test-linearize -fdump-ir $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-excludes: add\\.32.*\\$1, \\$0