Skip to content

Commit

Permalink
Fix multifile clause compilation bug where the entity for which the c…
Browse files Browse the repository at this point in the history
…lause is defined would not be available when querying the execution context of the clause head at runtime
  • Loading branch information
pmoura committed Aug 20, 2014
1 parent 905e787 commit 5d18e1a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/core.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8568,13 +8568,19 @@
% clause for a multifile predicate in "user"
DHead = '$lgt_debug'(rule(user::UserHead, N, BeginLine), ExCtx),
'$lgt_comp_ctx'(BodyCtx, Head, Entity, Sender, This, Self, Prefix, MetaVars, MetaCallCtx, BodyExCtx, Mode, Stack, BeginLine-EndLine),
'$lgt_execution_context'(ExCtx, _, Sender, This, Self, MetaCallCtx, Stack),
'$lgt_execution_context'(ExCtx, user, Sender, This, Self, MetaCallCtx, Stack),
'$lgt_execution_context'(BodyExCtx, Entity, Sender, This, Self, MetaCallCtx, Stack)
; Head = _::_ ->
% clause for a multifile predicate
; Head = Other::_ ->
% clause for an object multifile predicate
DHead = '$lgt_debug'(rule(Head, N, BeginLine), ExCtx),
'$lgt_comp_ctx'(BodyCtx, Head, Entity, Sender, This, Self, Prefix, MetaVars, MetaCallCtx, BodyExCtx, Mode, Stack, BeginLine-EndLine),
'$lgt_execution_context'(ExCtx, _, Sender, This, Self, MetaCallCtx, Stack),
'$lgt_execution_context'(ExCtx, Other, Sender, This, Self, MetaCallCtx, Stack),
'$lgt_execution_context'(BodyExCtx, Entity, Sender, This, Self, MetaCallCtx, Stack)
; Head = ':'(Other, _) ->
% clause for a module multifile predicate
DHead = '$lgt_debug'(rule(Head, N, BeginLine), ExCtx),
'$lgt_comp_ctx'(BodyCtx, Head, Entity, Sender, This, Self, Prefix, MetaVars, MetaCallCtx, BodyExCtx, Mode, Stack, BeginLine-EndLine),
'$lgt_execution_context'(ExCtx, Other, Sender, This, Self, MetaCallCtx, Stack),
'$lgt_execution_context'(BodyExCtx, Entity, Sender, This, Self, MetaCallCtx, Stack)
; % clause for a local predicate
DHead = '$lgt_debug'(rule(Head, N, BeginLine), ExCtx),
Expand Down

0 comments on commit 5d18e1a

Please sign in to comment.