Lines Matching refs:Ctx

81 static uint8_t readUint8(WasmObjectFile::ReadContext &Ctx) {  in readUint8()  argument
82 if (Ctx.Ptr == Ctx.End) in readUint8()
84 return *Ctx.Ptr++; in readUint8()
87 static uint32_t readUint32(WasmObjectFile::ReadContext &Ctx) { in readUint32() argument
88 if (Ctx.Ptr + 4 > Ctx.End) in readUint32()
90 uint32_t Result = support::endian::read32le(Ctx.Ptr); in readUint32()
91 Ctx.Ptr += 4; in readUint32()
95 static int32_t readFloat32(WasmObjectFile::ReadContext &Ctx) { in readFloat32() argument
96 if (Ctx.Ptr + 4 > Ctx.End) in readFloat32()
99 memcpy(&Result, Ctx.Ptr, sizeof(Result)); in readFloat32()
100 Ctx.Ptr += sizeof(Result); in readFloat32()
104 static int64_t readFloat64(WasmObjectFile::ReadContext &Ctx) { in readFloat64() argument
105 if (Ctx.Ptr + 8 > Ctx.End) in readFloat64()
108 memcpy(&Result, Ctx.Ptr, sizeof(Result)); in readFloat64()
109 Ctx.Ptr += sizeof(Result); in readFloat64()
113 static uint64_t readULEB128(WasmObjectFile::ReadContext &Ctx) { in readULEB128() argument
116 uint64_t Result = decodeULEB128(Ctx.Ptr, &Count, Ctx.End, &Error); in readULEB128()
119 Ctx.Ptr += Count; in readULEB128()
123 static StringRef readString(WasmObjectFile::ReadContext &Ctx) { in readString() argument
124 uint32_t StringLen = readULEB128(Ctx); in readString()
125 if (Ctx.Ptr + StringLen > Ctx.End) in readString()
128 StringRef(reinterpret_cast<const char *>(Ctx.Ptr), StringLen); in readString()
129 Ctx.Ptr += StringLen; in readString()
133 static int64_t readLEB128(WasmObjectFile::ReadContext &Ctx) { in readLEB128() argument
136 uint64_t Result = decodeSLEB128(Ctx.Ptr, &Count, Ctx.End, &Error); in readLEB128()
139 Ctx.Ptr += Count; in readLEB128()
143 static uint8_t readVaruint1(WasmObjectFile::ReadContext &Ctx) { in readVaruint1() argument
144 int64_t Result = readLEB128(Ctx); in readVaruint1()
150 static int32_t readVarint32(WasmObjectFile::ReadContext &Ctx) { in readVarint32() argument
151 int64_t Result = readLEB128(Ctx); in readVarint32()
157 static uint32_t readVaruint32(WasmObjectFile::ReadContext &Ctx) { in readVaruint32() argument
158 uint64_t Result = readULEB128(Ctx); in readVaruint32()
164 static int64_t readVarint64(WasmObjectFile::ReadContext &Ctx) { in readVarint64() argument
165 return readLEB128(Ctx); in readVarint64()
168 static uint64_t readVaruint64(WasmObjectFile::ReadContext &Ctx) { in readVaruint64() argument
169 return readULEB128(Ctx); in readVaruint64()
172 static uint8_t readOpcode(WasmObjectFile::ReadContext &Ctx) { in readOpcode() argument
173 return readUint8(Ctx); in readOpcode()
177 WasmObjectFile::ReadContext &Ctx) { in readInitExpr() argument
178 auto Start = Ctx.Ptr; in readInitExpr()
181 Expr.Inst.Opcode = readOpcode(Ctx); in readInitExpr()
184 Expr.Inst.Value.Int32 = readVarint32(Ctx); in readInitExpr()
187 Expr.Inst.Value.Int64 = readVarint64(Ctx); in readInitExpr()
190 Expr.Inst.Value.Float32 = readFloat32(Ctx); in readInitExpr()
193 Expr.Inst.Value.Float64 = readFloat64(Ctx); in readInitExpr()
196 Expr.Inst.Value.Global = readULEB128(Ctx); in readInitExpr()
199 wasm::ValType Ty = static_cast<wasm::ValType>(readULEB128(Ctx)); in readInitExpr()
211 uint8_t EndOpcode = readOpcode(Ctx); in readInitExpr()
217 Ctx.Ptr = Start; in readInitExpr()
219 uint8_t Opcode = readOpcode(Ctx); in readInitExpr()
227 readULEB128(Ctx); in readInitExpr()
237 Expr.Body = ArrayRef<uint8_t>(Start, Ctx.Ptr - Start); in readInitExpr()
250 static wasm::WasmLimits readLimits(WasmObjectFile::ReadContext &Ctx) { in readLimits() argument
252 Result.Flags = readVaruint32(Ctx); in readLimits()
253 Result.Minimum = readVaruint64(Ctx); in readLimits()
255 Result.Maximum = readVaruint64(Ctx); in readLimits()
259 static wasm::WasmTableType readTableType(WasmObjectFile::ReadContext &Ctx) { in readTableType() argument
261 TableType.ElemType = wasm::ValType(readVaruint32(Ctx)); in readTableType()
262 TableType.Limits = readLimits(Ctx); in readTableType()
266 static Error readSection(WasmSection &Section, WasmObjectFile::ReadContext &Ctx, in readSection() argument
268 Section.Type = readUint8(Ctx); in readSection()
272 const uint8_t *PreSizePtr = Ctx.Ptr; in readSection()
273 uint32_t Size = readVaruint32(Ctx); in readSection()
274 Section.HeaderSecSizeEncodingLen = Ctx.Ptr - PreSizePtr; in readSection()
275 Section.Offset = Ctx.Ptr - Ctx.Start; in readSection()
279 if (Ctx.Ptr + Size > Ctx.End) in readSection()
284 SectionCtx.Start = Ctx.Ptr; in readSection()
285 SectionCtx.Ptr = Ctx.Ptr; in readSection()
286 SectionCtx.End = Ctx.Ptr + Size; in readSection()
291 Ctx.Ptr += SectionNameSize; in readSection()
301 Section.Content = ArrayRef<uint8_t>(Ctx.Ptr, Size); in readSection()
302 Ctx.Ptr += Size; in readSection()
316 ReadContext Ctx; in WasmObjectFile() local
317 Ctx.Start = getData().bytes_begin(); in WasmObjectFile()
318 Ctx.Ptr = Ctx.Start + 4; in WasmObjectFile()
319 Ctx.End = Ctx.Start + getData().size(); in WasmObjectFile()
321 if (Ctx.Ptr + 4 > Ctx.End) { in WasmObjectFile()
327 Header.Version = readUint32(Ctx); in WasmObjectFile()
336 while (Ctx.Ptr < Ctx.End) { in WasmObjectFile()
338 if ((Err = readSection(Sec, Ctx, Checker))) in WasmObjectFile()
348 ReadContext Ctx; in parseSection() local
349 Ctx.Start = Sec.Content.data(); in parseSection()
350 Ctx.End = Ctx.Start + Sec.Content.size(); in parseSection()
351 Ctx.Ptr = Ctx.Start; in parseSection()
354 return parseCustomSection(Sec, Ctx); in parseSection()
356 return parseTypeSection(Ctx); in parseSection()
358 return parseImportSection(Ctx); in parseSection()
360 return parseFunctionSection(Ctx); in parseSection()
362 return parseTableSection(Ctx); in parseSection()
364 return parseMemorySection(Ctx); in parseSection()
366 return parseTagSection(Ctx); in parseSection()
368 return parseGlobalSection(Ctx); in parseSection()
370 return parseExportSection(Ctx); in parseSection()
372 return parseStartSection(Ctx); in parseSection()
374 return parseElemSection(Ctx); in parseSection()
376 return parseCodeSection(Ctx); in parseSection()
378 return parseDataSection(Ctx); in parseSection()
380 return parseDataCountSection(Ctx); in parseSection()
387 Error WasmObjectFile::parseDylinkSection(ReadContext &Ctx) { in parseDylinkSection() argument
391 DylinkInfo.MemorySize = readVaruint32(Ctx); in parseDylinkSection()
392 DylinkInfo.MemoryAlignment = readVaruint32(Ctx); in parseDylinkSection()
393 DylinkInfo.TableSize = readVaruint32(Ctx); in parseDylinkSection()
394 DylinkInfo.TableAlignment = readVaruint32(Ctx); in parseDylinkSection()
395 uint32_t Count = readVaruint32(Ctx); in parseDylinkSection()
397 DylinkInfo.Needed.push_back(readString(Ctx)); in parseDylinkSection()
400 if (Ctx.Ptr != Ctx.End) in parseDylinkSection()
406 Error WasmObjectFile::parseDylink0Section(ReadContext &Ctx) { in parseDylink0Section() argument
411 const uint8_t *OrigEnd = Ctx.End; in parseDylink0Section()
412 while (Ctx.Ptr < OrigEnd) { in parseDylink0Section()
413 Ctx.End = OrigEnd; in parseDylink0Section()
414 uint8_t Type = readUint8(Ctx); in parseDylink0Section()
415 uint32_t Size = readVaruint32(Ctx); in parseDylink0Section()
418 Ctx.End = Ctx.Ptr + Size; in parseDylink0Section()
422 DylinkInfo.MemorySize = readVaruint32(Ctx); in parseDylink0Section()
423 DylinkInfo.MemoryAlignment = readVaruint32(Ctx); in parseDylink0Section()
424 DylinkInfo.TableSize = readVaruint32(Ctx); in parseDylink0Section()
425 DylinkInfo.TableAlignment = readVaruint32(Ctx); in parseDylink0Section()
428 Count = readVaruint32(Ctx); in parseDylink0Section()
430 DylinkInfo.Needed.push_back(readString(Ctx)); in parseDylink0Section()
434 uint32_t Count = readVaruint32(Ctx); in parseDylink0Section()
436 DylinkInfo.ExportInfo.push_back({readString(Ctx), readVaruint32(Ctx)}); in parseDylink0Section()
441 uint32_t Count = readVaruint32(Ctx); in parseDylink0Section()
444 {readString(Ctx), readString(Ctx), readVaruint32(Ctx)}); in parseDylink0Section()
450 Ctx.Ptr += Size; in parseDylink0Section()
453 if (Ctx.Ptr != Ctx.End) { in parseDylink0Section()
459 if (Ctx.Ptr != Ctx.End) in parseDylink0Section()
465 Error WasmObjectFile::parseNameSection(ReadContext &Ctx) { in parseNameSection() argument
470 while (Ctx.Ptr < Ctx.End) { in parseNameSection()
471 uint8_t Type = readUint8(Ctx); in parseNameSection()
472 uint32_t Size = readVaruint32(Ctx); in parseNameSection()
473 const uint8_t *SubSectionEnd = Ctx.Ptr + Size; in parseNameSection()
478 uint32_t Count = readVaruint32(Ctx); in parseNameSection()
480 uint32_t Index = readVaruint32(Ctx); in parseNameSection()
481 StringRef Name = readString(Ctx); in parseNameSection()
517 Ctx.Ptr += Size; in parseNameSection()
520 if (Ctx.Ptr != SubSectionEnd) in parseNameSection()
525 if (Ctx.Ptr != Ctx.End) in parseNameSection()
531 Error WasmObjectFile::parseLinkingSection(ReadContext &Ctx) { in parseLinkingSection() argument
534 LinkingData.Version = readVaruint32(Ctx); in parseLinkingSection()
542 const uint8_t *OrigEnd = Ctx.End; in parseLinkingSection()
543 while (Ctx.Ptr < OrigEnd) { in parseLinkingSection()
544 Ctx.End = OrigEnd; in parseLinkingSection()
545 uint8_t Type = readUint8(Ctx); in parseLinkingSection()
546 uint32_t Size = readVaruint32(Ctx); in parseLinkingSection()
549 Ctx.End = Ctx.Ptr + Size; in parseLinkingSection()
552 if (Error Err = parseLinkingSectionSymtab(Ctx)) in parseLinkingSection()
556 uint32_t Count = readVaruint32(Ctx); in parseLinkingSection()
561 DataSegments[I].Data.Name = readString(Ctx); in parseLinkingSection()
562 DataSegments[I].Data.Alignment = readVaruint32(Ctx); in parseLinkingSection()
563 DataSegments[I].Data.LinkingFlags = readVaruint32(Ctx); in parseLinkingSection()
568 uint32_t Count = readVaruint32(Ctx); in parseLinkingSection()
572 Init.Priority = readVaruint32(Ctx); in parseLinkingSection()
573 Init.Symbol = readVaruint32(Ctx); in parseLinkingSection()
583 if (Error Err = parseLinkingSectionComdat(Ctx)) in parseLinkingSection()
587 Ctx.Ptr += Size; in parseLinkingSection()
590 if (Ctx.Ptr != Ctx.End) in parseLinkingSection()
594 if (Ctx.Ptr != OrigEnd) in parseLinkingSection()
600 Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) { in parseLinkingSectionSymtab() argument
601 uint32_t Count = readVaruint32(Ctx); in parseLinkingSectionSymtab()
635 Info.Kind = readUint8(Ctx); in parseLinkingSectionSymtab()
636 Info.Flags = readVaruint32(Ctx); in parseLinkingSectionSymtab()
641 Info.ElementIndex = readVaruint32(Ctx); in parseLinkingSectionSymtab()
647 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
656 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
667 Info.ElementIndex = readVaruint32(Ctx); in parseLinkingSectionSymtab()
677 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
686 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
697 Info.ElementIndex = readVaruint32(Ctx); in parseLinkingSectionSymtab()
707 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
716 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
727 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
729 auto Index = readVaruint32(Ctx); in parseLinkingSectionSymtab()
730 auto Offset = readVaruint64(Ctx); in parseLinkingSectionSymtab()
731 auto Size = readVaruint64(Ctx); in parseLinkingSectionSymtab()
755 Info.ElementIndex = readVaruint32(Ctx); in parseLinkingSectionSymtab()
763 Info.ElementIndex = readVaruint32(Ctx); in parseLinkingSectionSymtab()
773 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
783 Info.Name = readString(Ctx); in parseLinkingSectionSymtab()
815 Error WasmObjectFile::parseLinkingSectionComdat(ReadContext &Ctx) { in parseLinkingSectionComdat() argument
816 uint32_t ComdatCount = readVaruint32(Ctx); in parseLinkingSectionComdat()
819 StringRef Name = readString(Ctx); in parseLinkingSectionComdat()
825 uint32_t Flags = readVaruint32(Ctx); in parseLinkingSectionComdat()
830 uint32_t EntryCount = readVaruint32(Ctx); in parseLinkingSectionComdat()
832 unsigned Kind = readVaruint32(Ctx); in parseLinkingSectionComdat()
833 unsigned Index = readVaruint32(Ctx); in parseLinkingSectionComdat()
871 Error WasmObjectFile::parseProducersSection(ReadContext &Ctx) { in parseProducersSection() argument
873 uint32_t Fields = readVaruint32(Ctx); in parseProducersSection()
875 StringRef FieldName = readString(Ctx); in parseProducersSection()
893 uint32_t ValueCount = readVaruint32(Ctx); in parseProducersSection()
896 StringRef Name = readString(Ctx); in parseProducersSection()
897 StringRef Version = readString(Ctx); in parseProducersSection()
906 if (Ctx.Ptr != Ctx.End) in parseProducersSection()
912 Error WasmObjectFile::parseTargetFeaturesSection(ReadContext &Ctx) { in parseTargetFeaturesSection() argument
914 uint32_t FeatureCount = readVaruint32(Ctx); in parseTargetFeaturesSection()
917 Feature.Prefix = readUint8(Ctx); in parseTargetFeaturesSection()
927 Feature.Name = std::string(readString(Ctx)); in parseTargetFeaturesSection()
935 if (Ctx.Ptr != Ctx.End) in parseTargetFeaturesSection()
942 Error WasmObjectFile::parseRelocSection(StringRef Name, ReadContext &Ctx) { in parseRelocSection() argument
943 uint32_t SectionIndex = readVaruint32(Ctx); in parseRelocSection()
948 uint32_t RelocCount = readVaruint32(Ctx); in parseRelocSection()
953 uint32_t type = readVaruint32(Ctx); in parseRelocSection()
955 Reloc.Offset = readVaruint32(Ctx); in parseRelocSection()
960 Reloc.Index = readVaruint32(Ctx); in parseRelocSection()
1012 Reloc.Addend = readVarint32(Ctx); in parseRelocSection()
1022 Reloc.Addend = readVarint64(Ctx); in parseRelocSection()
1028 Reloc.Addend = readVarint32(Ctx); in parseRelocSection()
1034 Reloc.Addend = readVarint64(Ctx); in parseRelocSection()
1040 Reloc.Addend = readVarint32(Ctx); in parseRelocSection()
1074 if (Ctx.Ptr != Ctx.End) in parseRelocSection()
1080 Error WasmObjectFile::parseCustomSection(WasmSection &Sec, ReadContext &Ctx) { in parseCustomSection() argument
1082 if (Error Err = parseDylinkSection(Ctx)) in parseCustomSection()
1085 if (Error Err = parseDylink0Section(Ctx)) in parseCustomSection()
1088 if (Error Err = parseNameSection(Ctx)) in parseCustomSection()
1091 if (Error Err = parseLinkingSection(Ctx)) in parseCustomSection()
1094 if (Error Err = parseProducersSection(Ctx)) in parseCustomSection()
1097 if (Error Err = parseTargetFeaturesSection(Ctx)) in parseCustomSection()
1100 if (Error Err = parseRelocSection(Sec.Name, Ctx)) in parseCustomSection()
1106 Error WasmObjectFile::parseTypeSection(ReadContext &Ctx) { in parseTypeSection() argument
1107 uint32_t Count = readVaruint32(Ctx); in parseTypeSection()
1111 uint8_t Form = readUint8(Ctx); in parseTypeSection()
1116 uint32_t ParamCount = readVaruint32(Ctx); in parseTypeSection()
1119 uint32_t ParamType = readUint8(Ctx); in parseTypeSection()
1122 uint32_t ReturnCount = readVaruint32(Ctx); in parseTypeSection()
1124 uint32_t ReturnType = readUint8(Ctx); in parseTypeSection()
1129 if (Ctx.Ptr != Ctx.End) in parseTypeSection()
1135 Error WasmObjectFile::parseImportSection(ReadContext &Ctx) { in parseImportSection() argument
1136 uint32_t Count = readVaruint32(Ctx); in parseImportSection()
1141 Im.Module = readString(Ctx); in parseImportSection()
1142 Im.Field = readString(Ctx); in parseImportSection()
1143 Im.Kind = readUint8(Ctx); in parseImportSection()
1147 Im.SigIndex = readVaruint32(Ctx); in parseImportSection()
1154 Im.Global.Type = readUint8(Ctx); in parseImportSection()
1155 Im.Global.Mutable = readVaruint1(Ctx); in parseImportSection()
1158 Im.Memory = readLimits(Ctx); in parseImportSection()
1163 Im.Table = readTableType(Ctx); in parseImportSection()
1174 if (readUint8(Ctx) != 0) // Reserved 'attribute' field in parseImportSection()
1177 Im.SigIndex = readVaruint32(Ctx); in parseImportSection()
1188 if (Ctx.Ptr != Ctx.End) in parseImportSection()
1194 Error WasmObjectFile::parseFunctionSection(ReadContext &Ctx) { in parseFunctionSection() argument
1195 uint32_t Count = readVaruint32(Ctx); in parseFunctionSection()
1199 uint32_t Type = readVaruint32(Ctx); in parseFunctionSection()
1207 if (Ctx.Ptr != Ctx.End) in parseFunctionSection()
1213 Error WasmObjectFile::parseTableSection(ReadContext &Ctx) { in parseTableSection() argument
1215 uint32_t Count = readVaruint32(Ctx); in parseTableSection()
1219 T.Type = readTableType(Ctx); in parseTableSection()
1229 if (Ctx.Ptr != Ctx.End) in parseTableSection()
1235 Error WasmObjectFile::parseMemorySection(ReadContext &Ctx) { in parseMemorySection() argument
1236 uint32_t Count = readVaruint32(Ctx); in parseMemorySection()
1239 auto Limits = readLimits(Ctx); in parseMemorySection()
1244 if (Ctx.Ptr != Ctx.End) in parseMemorySection()
1250 Error WasmObjectFile::parseTagSection(ReadContext &Ctx) { in parseTagSection() argument
1252 uint32_t Count = readVaruint32(Ctx); in parseTagSection()
1256 if (readUint8(Ctx) != 0) // Reserved 'attribute' field in parseTagSection()
1259 uint32_t Type = readVaruint32(Ctx); in parseTagSection()
1269 if (Ctx.Ptr != Ctx.End) in parseTagSection()
1275 Error WasmObjectFile::parseGlobalSection(ReadContext &Ctx) { in parseGlobalSection() argument
1277 uint32_t Count = readVaruint32(Ctx); in parseGlobalSection()
1282 Global.Type.Type = readUint8(Ctx); in parseGlobalSection()
1283 Global.Type.Mutable = readVaruint1(Ctx); in parseGlobalSection()
1284 if (Error Err = readInitExpr(Global.InitExpr, Ctx)) in parseGlobalSection()
1288 if (Ctx.Ptr != Ctx.End) in parseGlobalSection()
1294 Error WasmObjectFile::parseExportSection(ReadContext &Ctx) { in parseExportSection() argument
1295 uint32_t Count = readVaruint32(Ctx); in parseExportSection()
1301 Ex.Name = readString(Ctx); in parseExportSection()
1302 Ex.Kind = readUint8(Ctx); in parseExportSection()
1303 Ex.Index = readVaruint32(Ctx); in parseExportSection()
1368 if (Ctx.Ptr != Ctx.End) in parseExportSection()
1451 Error WasmObjectFile::parseStartSection(ReadContext &Ctx) { in parseStartSection() argument
1452 StartFunction = readVaruint32(Ctx); in parseStartSection()
1459 Error WasmObjectFile::parseCodeSection(ReadContext &Ctx) { in parseCodeSection() argument
1461 uint32_t FunctionCount = readVaruint32(Ctx); in parseCodeSection()
1469 const uint8_t *FunctionStart = Ctx.Ptr; in parseCodeSection()
1470 uint32_t Size = readVaruint32(Ctx); in parseCodeSection()
1471 const uint8_t *FunctionEnd = Ctx.Ptr + Size; in parseCodeSection()
1473 Function.CodeOffset = Ctx.Ptr - FunctionStart; in parseCodeSection()
1475 Function.CodeSectionOffset = FunctionStart - Ctx.Start; in parseCodeSection()
1478 uint32_t NumLocalDecls = readVaruint32(Ctx); in parseCodeSection()
1482 Decl.Count = readVaruint32(Ctx); in parseCodeSection()
1483 Decl.Type = readUint8(Ctx); in parseCodeSection()
1487 uint32_t BodySize = FunctionEnd - Ctx.Ptr; in parseCodeSection()
1489 if (Ctx.Ptr + BodySize > Ctx.End) { in parseCodeSection()
1493 Function.Body = ArrayRef<uint8_t>(Ctx.Ptr, BodySize); in parseCodeSection()
1496 Ctx.Ptr += BodySize; in parseCodeSection()
1497 assert(Ctx.Ptr == FunctionEnd); in parseCodeSection()
1499 if (Ctx.Ptr != Ctx.End) in parseCodeSection()
1505 Error WasmObjectFile::parseElemSection(ReadContext &Ctx) { in parseElemSection() argument
1506 uint32_t Count = readVaruint32(Ctx); in parseElemSection()
1510 Segment.Flags = readVaruint32(Ctx); in parseElemSection()
1520 Segment.TableNumber = readVaruint32(Ctx); in parseElemSection()
1532 if (Error Err = readInitExpr(Segment.Offset, Ctx)) in parseElemSection()
1537 auto ElemKind = readVaruint32(Ctx); in parseElemSection()
1560 uint32_t NumElems = readVaruint32(Ctx); in parseElemSection()
1562 Segment.Functions.push_back(readVaruint32(Ctx)); in parseElemSection()
1566 if (Ctx.Ptr != Ctx.End) in parseElemSection()
1572 Error WasmObjectFile::parseDataSection(ReadContext &Ctx) { in parseDataSection() argument
1574 uint32_t Count = readVaruint32(Ctx); in parseDataSection()
1581 Segment.Data.InitFlags = readVaruint32(Ctx); in parseDataSection()
1584 ? readVaruint32(Ctx) in parseDataSection()
1587 if (Error Err = readInitExpr(Segment.Data.Offset, Ctx)) in parseDataSection()
1594 uint32_t Size = readVaruint32(Ctx); in parseDataSection()
1595 if (Size > (size_t)(Ctx.End - Ctx.Ptr)) in parseDataSection()
1598 Segment.Data.Content = ArrayRef<uint8_t>(Ctx.Ptr, Size); in parseDataSection()
1604 Segment.SectionOffset = Ctx.Ptr - Ctx.Start; in parseDataSection()
1605 Ctx.Ptr += Size; in parseDataSection()
1608 if (Ctx.Ptr != Ctx.End) in parseDataSection()
1614 Error WasmObjectFile::parseDataCountSection(ReadContext &Ctx) { in parseDataCountSection() argument
1615 DataCount = readVaruint32(Ctx); in parseDataCountSection()