MCPcopy Create free account
hub / github.com/R-Fuzz/symsan / getCustomFunctionType

Method getCustomFunctionType

instrumentation/UCSanPass.cpp:2152–2175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2150}
2151
2152TransformedFunction UCSan::getCustomFunctionType(FunctionType *T) {
2153 SmallVector<Type *, 4> ArgTypes;
2154
2155 // Some parameters of the custom function being constructed are
2156 // parameters of T. Record the mapping from parameters of T to
2157 // parameters of the custom function, so that parameter attributes
2158 // at call sites can be updated.
2159 std::vector<unsigned> ArgumentIndexMapping;
2160 for (unsigned i = 0, ie = T->getNumParams(); i != ie; ++i) {
2161 Type* param_type = T->getParamType(i);
2162 ArgumentIndexMapping.push_back(ArgTypes.size());
2163 ArgTypes.push_back(param_type);
2164 }
2165 for (unsigned i = 0, e = T->getNumParams(); i != e; ++i)
2166 ArgTypes.push_back(getShadowTy(T->getParamType(i)));
2167 if (T->isVarArg())
2168 ArgTypes.push_back(PrimitiveShadowPtrTy);
2169 Type *RetType = T->getReturnType();
2170 if (!RetType->isVoidTy())
2171 ArgTypes.push_back(PointerType::getUnqual(getShadowTy(RetType)));
2172 return TransformedFunction(
2173 T, FunctionType::get(T->getReturnType(), ArgTypes, T->isVarArg()),
2174 ArgumentIndexMapping);
2175}
2176
2177Value *UCSanFunction::checkPointer(Value *Ptr, Value *Size, bool dereference,
2178 IRBuilder<> &IRB, uint32_t TypeID) {

Callers 1

visitWrappedCallBaseMethod · 0.45

Calls 3

TransformedFunctionClass · 0.70
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected