aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-03-04 12:24:34 +0100
committerHans Bolinder <[email protected]>2014-03-04 12:24:34 +0100
commitb5f60940c8cb73873392e3955cbf30a6c7079ccf (patch)
treec296c3ca600808675e46c0c3e91f2b64c515cb6e /lib/stdlib/src
parent477824259524f918ad94d36fb0d3b746e4b12111 (diff)
parent28d4b0cfc27826d7b273edd0143c7dc2f14bf86e (diff)
downloadotp-b5f60940c8cb73873392e3955cbf30a6c7079ccf.tar.gz
otp-b5f60940c8cb73873392e3955cbf30a6c7079ccf.tar.bz2
otp-b5f60940c8cb73873392e3955cbf30a6c7079ccf.zip
Merge branch 'hb/stdlib/qlc_fix/OTP-11758'
* hb/stdlib/qlc_fix/OTP-11758: Fix a qlc bug where filters were erroneously optimized away
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/qlc_pt.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/stdlib/src/qlc_pt.erl b/lib/stdlib/src/qlc_pt.erl
index c26764eb18..b6bb758dfb 100644
--- a/lib/stdlib/src/qlc_pt.erl
+++ b/lib/stdlib/src/qlc_pt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -1218,13 +1218,14 @@ lu_skip(ColConstants, FilterData, PatternFrame, PatternVars,
%% column, the filter will not be skipped.
%% (an example: {X=1} <- ..., X =:= 1).
length(D = Cols -- PatternColumns) =:= 1,
- Frame <- SFs,
- begin
+ {{_,Col} = Column, Constants} <- D,
+ %% Check that the following holds for all frames.
+ lists:all(
+ fun(Frame) ->
%% The column is compared/matched against a constant.
%% If there are no more comparisons/matches then
%% the filter can be replaced by the lookup of
%% the constant.
- [{{_,Col} = Column, Constants}] = D,
{VarI, FrameI} = unify_column(Frame, PV, Col, BindFun,
Imported),
VarValues = deref_skip(VarI, FrameI, LookupOp, Imported),
@@ -1253,7 +1254,7 @@ lu_skip(ColConstants, FilterData, PatternFrame, PatternVars,
length(VarValues) =< 1 andalso
(Constants -- LookedUpConstants =:= []) andalso
bindings_is_subset(Frame, F2, Imported)
- end],
+ end, SFs)],
ColFils = family_list(ColFil),
%% The skip tag 'all' means that all filters are covered by the lookup.
%% It does not imply that there is only one generator as is the case