Change count to string_words

Co-authored-by: Rodrigo Locatti <reinuseslisp@airmail.cc>
This commit is contained in:
comex 2020-11-25 18:59:59 -05:00 committed by Rodrigo Locatti
parent 63c5b548c5
commit c095705f59

View File

@ -42,10 +42,10 @@ std::vector<u32> Module::Assemble() const {
}
for (const std::string_view extension_name : extensions) {
size_t count = WordsInString(extension_name);
words.push_back(MakeWord0(spv::Op::OpExtension, count + 1));
size_t string_words = WordsInString(extension_name);
words.push_back(MakeWord0(spv::Op::OpExtension, string_words + 1));
size_t insert_index = words.size();
words.resize(words.size() + count);
words.resize(words.size() + string_words);
InsertStringView(words, insert_index, extension_name);
}