File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1717 steps :
1818 - name : Setup clang-format
1919 run : |
20- sudo apt-get install -yqq clang-format-12
20+ sudo apt-get install -yqq clang-format
2121 - name : Checkout repository
2222 uses : actions/checkout@v3
2323 with :
2828 - name : Run clang-format
2929 run : |
3030 git diff origin/${{ github.base_ref }} -U0 --no-color -- '**/*.cpp' '**/*.cc' '**/*.h' '**/*.hh' '**/*.hpp' \
31- | clang-format-diff-12 -p1 >not-formatted.diff 2>&1
31+ | clang-format-diff -p1 >not-formatted.diff 2>&1
3232 - name : Check formatting
3333 run : |
3434 if ! grep -q '[^[:space:]]' not-formatted.diff ; then
Original file line number Diff line number Diff line change @@ -3569,14 +3569,21 @@ static SpvReflectResult ParseStaticallyUsedResources(SpvReflectPrvParser* p_pars
35693569 }
35703570 used_acessed_count += p_parser -> functions [j ].accessed_variable_count ;
35713571 }
3572- SpvReflectPrvAccessedVariable * p_used_accesses = NULL ;
3573- if (used_acessed_count > 0 ) {
3574- p_used_accesses = (SpvReflectPrvAccessedVariable * )calloc (used_acessed_count , sizeof (SpvReflectPrvAccessedVariable ));
3575- if (IsNull (p_used_accesses )) {
3576- SafeFree (p_called_functions );
3577- return SPV_REFLECT_RESULT_ERROR_ALLOC_FAILED ;
3578- }
3572+
3573+ // If there are no used accessed, this is something like an empty function/early return
3574+ // Basically there is going to be nothing to reflect, but everything after this expects |p_used_accesses| to be allocated with
3575+ // real memory, see https://github.com/KhronosGroup/SPIRV-Reflect/issues/319
3576+ if (used_acessed_count == 0 ) {
3577+ return SPV_REFLECT_RESULT_SUCCESS ;
35793578 }
3579+
3580+ SpvReflectPrvAccessedVariable * p_used_accesses =
3581+ (SpvReflectPrvAccessedVariable * )calloc (used_acessed_count , sizeof (SpvReflectPrvAccessedVariable ));
3582+ if (IsNull (p_used_accesses )) {
3583+ SafeFree (p_called_functions );
3584+ return SPV_REFLECT_RESULT_ERROR_ALLOC_FAILED ;
3585+ }
3586+
35803587 used_acessed_count = 0 ;
35813588 for (size_t i = 0 , j = 0 ; i < called_function_count ; ++ i ) {
35823589 while (p_parser -> functions [j ].id != p_called_functions [i ]) {
You can’t perform that action at this time.
0 commit comments