LLDB mainline
MachOTrie.cpp File Reference
#include "MachOTrie.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Flags.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
#include <cstdio>

Go to the source code of this file.

Variables

static constexpr size_t kMaxTrieSymbolNameLength = 1 << 20
 Upper bound on the length of a symbol name assembled from export-trie edge labels.

Variable Documentation

◆ kMaxTrieSymbolNameLength

size_t kMaxTrieSymbolNameLength = 1 << 20
staticconstexpr

Upper bound on the length of a symbol name assembled from export-trie edge labels.

A corrupt trie can encode an edge label whose terminator is far away in the trie data, so a single label is many megabytes long; appending it to the running name would otherwise request an unbounded allocation. No legitimate symbol name comes close to this size. Also 1 MiB is the symbol length limit in ld.

Definition at line 29 of file MachOTrie.cpp.