Skip to content

Commit 553a651

Browse files
committed
Error when calling which from generated functions without setting the world.
1 parent fa82e4c commit 553a651

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
@@ -1564,6 +1564,7 @@ function _which(@nospecialize(tt::Type);
15641564
method_table::Union{Nothing,Core.MethodTable,Core.Compiler.MethodTableView}=nothing,
15651565
world::UInt=get_world_counter(),
15661566
raise::Bool=true)
1567+
world == typemax(UInt) && error("code reflection cannot be used from generated functions")
15671568
if method_table === nothing
15681569
table = Core.Compiler.InternalMethodTable(world)
15691570
elseif method_table isa Core.MethodTable

0 commit comments

Comments
 (0)