Skip to content

Commit

Permalink
farptr: dont use sym wrappers in SymMemb [#56]
Browse files Browse the repository at this point in the history
This avoids strict-aliasing violation casts and unbinds
us from the wrapper size.
  • Loading branch information
stsp committed Feb 9, 2019
1 parent 3fc774e commit b197c40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fdpp/farptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class SymMemb : public T, public MembBase<T, F> {
public:
SymMemb() = default;
SymMemb(const SymMemb&) = delete;
SymWrp<T>& operator =(T& f) { *(T *)this = f; return *(SymWrp<T> *)this; }
T& operator =(const T& f) { *(T *)this = f; return *this; }
FarPtr<T> operator &() const { return this->lookup_sym(); }
};

Expand All @@ -529,7 +529,7 @@ class SymMemb2 : public MembBase<T, F> {
public:
SymMemb2() = default;
SymMemb2(const SymMemb2&) = delete;
SymWrp2<T>& operator =(const T& f) { sym = f; return *(SymWrp2<T> *)this; }
T& operator =(const T& f) { sym = f; return sym; }
FarPtr<T> operator &() const { return this->lookup_sym(); }
operator T &() { return sym; }
};
Expand Down

0 comments on commit b197c40

Please sign in to comment.