Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
+ assert(block->id == BLOCKINFO_BLOCK); + + if (!vkd3d_array_reserve((void **)&sm6->abbrevs, &sm6->abbrev_capacity, sm6->abbrev_count + 1, sizeof(*sm6->abbrevs)) + || !(global_abbrev = vkd3d_malloc(sizeof(*global_abbrev) + count * sizeof(global_abbrev->abbrev.operands[0])))) + { + ERR("Failed to allocate global abbreviation.\n"); + return VKD3D_ERROR_OUT_OF_MEMORY; + } + + if ((ret = dxil_abbrev_init(&global_abbrev->abbrev, count, sm6)) < 0) + { + vkd3d_free(global_abbrev); + return ret; + } + + global_abbrev->block_id = block->blockinfo_bid; This assumes that a `SETBID` has already been seen, which is mandated by https://www.llvm.org/docs/BitCodeFormat.html#blockinfo-block. But is it enforced somewhere in the parser?
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/44#note_33202