Seite 1 von 1

Bugfix for PointerObservations transformer

Verfasst: 24. Mai 2016 13:07
von bhermann
Thanks to Patrick Müller we have a bugfix for my faulty implementation of PointerObservations.cpp.

Here is my buggy line:

Code: Alles auswählen

Constant* strVal = ConstantExpr::getGetElementPtr(Type::getInt8PtrTy(ctx), GVStr, indices, true);
And here is Patrick's fixed version:

Code: Alles auswählen

Constant* strVal = ConstantExpr::getGetElementPtr(0, GVStr, indices, true);
He is cleverly using an implementation detail of the called function:

Code: Alles auswählen

if (!Ty)
  Ty = cast<PointerType>(C->getType()->getScalarType())->getElementType();