Skip to content

Commit 596ad82

Browse files
authored
remove getString, which is not used, and was insecure to boot (WebAssembly#1966)
1 parent 56c5ff7 commit 596ad82

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/wasm-binary.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,8 @@ class WasmBinaryBuilder {
962962

963963
void read();
964964
void readUserSection(size_t payloadLen);
965-
bool more() { return pos < input.size();}
965+
966+
bool more() { return pos < input.size(); }
966967

967968
uint8_t getInt8();
968969
uint16_t getInt16();
@@ -979,7 +980,6 @@ class WasmBinaryBuilder {
979980
int64_t getS64LEB();
980981
Type getType();
981982
Type getConcreteType();
982-
Name getString();
983983
Name getInlineString();
984984
void verifyInt8(int8_t x);
985985
void verifyInt16(int16_t x);

src/wasm/wasm-binary.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -862,14 +862,6 @@ Type WasmBinaryBuilder::getConcreteType() {
862862
return type;
863863
}
864864

865-
Name WasmBinaryBuilder::getString() {
866-
if (debug) std::cerr << "<==" << std::endl;
867-
size_t offset = getInt32();
868-
Name ret = cashew::IString((&input[0]) + offset, false);
869-
if (debug) std::cerr << "getString: " << ret << " ==>" << std::endl;
870-
return ret;
871-
}
872-
873865
Name WasmBinaryBuilder::getInlineString() {
874866
if (debug) std::cerr << "<==" << std::endl;
875867
auto len = getU32LEB();

0 commit comments

Comments
 (0)