diff --git a/src/compiler.jl b/src/compiler.jl index 13fc301b0b..10dc9842d1 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -5316,10 +5316,10 @@ const cache_lock = ReentrantLock() asm = _thunk(job) obj = _link(job, asm...) if obj.adjoint isa Ptr{Nothing} - autodiff_cache[obj.adjoint] = (asm[2], asm[1]) + autodiff_cache[obj.adjoint] = (asm[2], asm[5]) end if obj.primal isa Ptr{Nothing} - autodiff_cache[obj.primal] = (asm[3], asm[1]) + autodiff_cache[obj.primal] = (asm[3], asm[5]) end cache[key] = obj end