FluxML / IRTools.jl

Mike's Little Intermediate Representation
MIT License
111 stars 35 forks source link

Bugreport: Everything crashes when running an example from the docstring #90

Open schlichtanders opened 3 years ago

schlichtanders commented 3 years ago

Hi here is one example docstring from pushfirst

julia> f(x) = 3x + 2
f (generic function with 1 method)

julia> ir = @code_ir f(1)
1: (%1, %2)
  %3 = 3 * %2
  %4 = %3 + 2
  return %4

julia> pushfirst!(ir, :(println("hello, world")))
%5

julia> ir
1: (%1, %2)
  %5 = println("hello, world")
  %3 = 3 * %2
  %4 = %3 + 2
  return %4

when running this with IRTools.func(ir)(f, 1) everything crashes. I experience similar behaviour everytime I try to insert literal values like "hello, world" in this case.

Probably this is just missing and wrong documentation - What is the current way of inserting literal values?

KDr2 commented 2 years ago

Seems that it works under Julia 1.7 and prior, but crashes on Julia 1.8.

simeonschaub commented 2 years ago

Could you post the whole stacktrace?