New issue
Advanced search Search tips

Issue 771756 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

blink-gc plugin false-positive when traced field is templated

Project Member Reported by reillyg@chromium.org, Oct 4 2017

Issue description

Example:

template <typename T>
class TracingWrapper : public GarbageCollectedFinalized<TracingWrapper<T>> {
 public:
  TracingWrapper(T value) : value_(value) {}

  template <typename U>
  static TracingWrapper<U>* Create(U value) {
    return new TracingWrapper<U>(value);
  }

  const T& value() const { return value_; }
  T& value() { return value_; }

  DEFINE_INLINE_TRACE() { value_.Trace(visitor); }

 private:
  T value_;
};

Error:

../../third_party/WebKit/Source/modules/imagecapture/ImageCapture.h:44:3: error: [blink-gc] Class 'TracingWrapper<blink::MediaTrackConstraints>' has untraced fields that require tracing.
  DEFINE_INLINE_TRACE() { value_.Trace(visitor); }
  ^
../../third_party/WebKit/Source/platform/heap/Visitor.h:94:31: note: expanded from macro 'DEFINE_INLINE_TRACE'
#define DEFINE_INLINE_TRACE() DEFINE_INLINE_TRACE_IMPL(EMPTY_MACRO_ARGUMENT)
                              ^
../../third_party/WebKit/Source/platform/heap/Visitor.h:82:16: note: expanded from macro 'DEFINE_INLINE_TRACE_IMPL'
  maybevirtual void Trace(blink::Visitor* visitor)
               ^
../../third_party/WebKit/Source/modules/imagecapture/ImageCapture.h:47:3: note: [blink-gc] Untraced field 'value_' declared here:
  T value_;

 
Status: WontFix (was: Untriaged)
That line should be:

DEFINE_INLINE_TRACE() { visitor->Trace(value); }

Sign in to add a comment