Skip to content

Commit eaa1e81

Browse files
maleadtvtjnash
authored andcommitted
Error when calling which from generated functions without setting the world.
1 parent 26d64c8 commit eaa1e81

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

base/reflection.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,7 @@ function _which(@nospecialize(tt::Type);
15661566
method_table::Union{Nothing,Core.MethodTable,Core.Compiler.MethodTableView}=nothing,
15671567
world::UInt=get_world_counter(),
15681568
raise::Bool=true)
1569+
world == typemax(UInt) && error("code reflection cannot be used from generated functions")
15691570
if method_table === nothing
15701571
table = Core.Compiler.InternalMethodTable(world)
15711572
elseif method_table isa Core.MethodTable

0 commit comments

Comments
 (0)