[clang] Correct value for offsetof

Summary:
update-submodule: facebook-clang-plugins

We used to translate `offsetof` by an unknown value.
This fixes it. It is now translated like an integer literal.

Reviewed By: ddino

Differential Revision: D15317799

fbshipit-source-id: ae89e0ec5
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent 81909abf23
commit b27c02ad35

@ -1 +1 @@
Subproject commit 36266f6c86041896bed32ffec0637fefbc4463e0
Subproject commit 8587e5208099b6422438609e15310e3a45ec0886

@ -3353,7 +3353,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| CXXStaticCastExpr (stmt_info, stmt_list, expr_info, cast_kind, _, _)
| CXXFunctionalCastExpr (stmt_info, stmt_list, expr_info, cast_kind, _) ->
cast_exprs_trans trans_state stmt_info stmt_list expr_info cast_kind
| IntegerLiteral (_, _, expr_info, integer_literal_info) ->
| IntegerLiteral (_, _, expr_info, integer_literal_info)
| OffsetOfExpr (_, _, expr_info, integer_literal_info) ->
integerLiteral_trans trans_state expr_info integer_literal_info
| StringLiteral (_, _, expr_info, str_list) ->
stringLiteral_trans trans_state expr_info (String.concat ~sep:"" str_list)
@ -3484,7 +3485,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
booleanValue_trans trans_state expr_info type_trait_info.Clang_ast_t.xtti_value
| CXXNoexceptExpr (_, _, expr_info, cxx_noexcept_expr_info) ->
booleanValue_trans trans_state expr_info cxx_noexcept_expr_info.Clang_ast_t.xnee_value
| OffsetOfExpr (_, _, expr_info) | VAArgExpr (_, [], expr_info) ->
| VAArgExpr (_, [], expr_info) ->
undefined_expr trans_state expr_info
| VAArgExpr (stmt_info, stmt :: _, ei) ->
va_arg_trans trans_state stmt_info stmt ei

@ -100,7 +100,6 @@ codetoanalyze/c/errors/resource_leaks/leak.c, fileNotClosed, 5, RESOURCE_LEAK, n
codetoanalyze/c/errors/resource_leaks/leak.c, socketNotClosed, 5, RESOURCE_LEAK, no_bucket
codetoanalyze/c/errors/sizeof/sizeof_706.c, sentinel_bad, 0, DIVIDE_BY_ZERO, no_bucket
codetoanalyze/c/frontend/enumeration/other_enum.c, other_enum_test, 4, DIVIDE_BY_ZERO, no_bucket
codetoanalyze/c/frontend/offsetof_expr/offsetof_expr.c, test_offsetof_expr, 3, DIVIDE_BY_ZERO, no_bucket
codetoanalyze/c/frontend/offsetof_expr/offsetof_expr.c, test_offsetof_expr, 5, DIVIDE_BY_ZERO, no_bucket
codetoanalyze/c/frontend/vaarg_expr/vaarg_expr.c, vaarg_foo, 6, DIVIDE_BY_ZERO, no_bucket
codetoanalyze/c/frontend/vaarg_expr/vaarg_expr.c, vaarg_foo, 8, DIVIDE_BY_ZERO, no_bucket

@ -36,7 +36,7 @@ digraph cfg {
"test_offsetof_expr.8f3e634fd0f68dff5e4bfedc8f65a55f_9" -> "test_offsetof_expr.8f3e634fd0f68dff5e4bfedc8f65a55f_2" ;
"test_offsetof_expr.8f3e634fd0f68dff5e4bfedc8f65a55f_10" [label="10: DeclStmt \n VARIABLE_DECLARED(i:int); [line 17, column 3]\n *&i:int=n$2 [line 17, column 3]\n EXIT_SCOPE(n$2); [line 17, column 3]\n " shape="box"]
"test_offsetof_expr.8f3e634fd0f68dff5e4bfedc8f65a55f_10" [label="10: DeclStmt \n VARIABLE_DECLARED(i:int); [line 17, column 3]\n *&i:int=2 [line 17, column 3]\n " shape="box"]
"test_offsetof_expr.8f3e634fd0f68dff5e4bfedc8f65a55f_10" -> "test_offsetof_expr.8f3e634fd0f68dff5e4bfedc8f65a55f_5" ;

Loading…
Cancel
Save