Permalink
Browse files

ignore getproperty/setproperty!

and also updated the set of analysed methods properly
  • Loading branch information...
pfitzseb committed Sep 11, 2018
1 parent 4ed7ee3 commit b799872ddc2ab82dd4cab7c403281f8a780f2620
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/trace.jl
View
@@ -11,14 +11,16 @@ Trace(w) = Trace(Set(), w)
isprimitive(f) = f isa Core.Builtin || f isa Core.IntrinsicFunction
const ignored_methods = [@which((1,2)[1])]
const ignored_methods = Set([@which((1,2)[1])])
const ignored_functions = Set([getproperty, setproperty!])
function Cassette.posthook(ctx::TraceurCtx, out, f, args...)
C, T = DynamicCall(f, args...), typeof.((f, args))
tra = ctx.metadata
(T ∈ tra.seen || isprimitive(f) || method(C) ∈ ignored_methods ||
method(C).module ∈ (Core, Core.Compiler)) && return nothing
(f ∈ ignored_functions || T ∈ tra.seen || isprimitive(f) ||
method(C) ∈ ignored_methods || method(C).module ∈ (Core, Core.Compiler)) && return nothing
push!(tra.seen, T)
analyse((a...) -> tra.warn(Warning(a...)), C)
return nothing
end

0 comments on commit b799872

Please sign in to comment.