X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.cpp;fp=src%2Floader%2FInterpreter.cpp;h=8b54fc177913de18a1266f885cc8e959b6eb4eef;hb=eb2ad5ffd08128d31af32f3929a3295fcfa251e9;hp=8f9e9dc6eff141aa69a1d5d13ad4662293b4b329;hpb=dc275497c592669dda75645604a9b35d32f63e90;p=l2e.git diff --git a/src/loader/Interpreter.cpp b/src/loader/Interpreter.cpp index 8f9e9dc..8b54fc1 100644 --- a/src/loader/Interpreter.cpp +++ b/src/loader/Interpreter.cpp @@ -329,7 +329,7 @@ void Interpreter::ReadObject(int typeId, int id, char *object, const PropertyLis *reinterpret_cast(iter) = GetObject(fd.TypeId(), *j); } else { - Postpone(typeId, id, fd.Offset() + (iter - aggregate), *j, fd.TypeId(), false); + Postpone(iter, *j, fd.TypeId(), false); } } } @@ -355,7 +355,7 @@ void Interpreter::ReadObject(int typeId, int id, char *object, const PropertyLis } } } else { - Postpone(typeId, id, fd.Offset(), i->second->GetIdentifier(), fd.TypeId(), !fd.IsReferenced()); + Postpone(object, i->second->GetIdentifier(), fd.TypeId(), !fd.IsReferenced(), fd.IsAggregate()); } } td.Load(object); @@ -860,11 +860,17 @@ bool Interpreter::CanLink(const Value &v) const { return v.IsLiteral() || source.IsDefined(v.GetIdentifier()); } -void Interpreter::Postpone(int type, int id, std::ptrdiff_t offset, const std::string &identifier, int linkedType, bool inlined) { +void Interpreter::Postpone( + char *dest, + const std::string &identifier, + int type, + bool inlined, + bool aggregate) { char *str(alloc.Alloc(identifier.size() + 1)); std::memcpy(str, identifier.c_str(), identifier.size()); str[identifier.size()] = '\0'; - postponedDefinitions.push_back(PostponedDefinition(type, id, offset, str, linkedType, inlined)); + postponedDefinitions.push_back( + PostponedDefinition(dest, str, type, inlined, aggregate)); }