This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Retrieve a character from CompoundLiteralExpr as an initializer for constant arrays.
AbandonedPublic

Authored by ASDenysPetrov on Aug 13 2021, 6:17 AM.

Details

Summary

Add support of handling CompoundLiteralExpr in RegionStoreManager::getBindingForFieldOrElementCommon. Retrieve a value from CompoundLiteralExpr which is an initializer of constant arrays in a global scope.

Example:

const int arr[8] = (const int[8]){1, 2, 3, 4}; // compound literal
auto x1 = arr[2]; // 3
auto x2 = arr[4]; // 0
auto x3 = arr[8]; // undef

Diff Detail