Skip to content

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

Open
@schlichtanders

Description

@schlichtanders

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions