~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/compiler/src/beam_validator.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
 
19
19
-module(beam_validator).
20
20
 
 
21
-compile({no_auto_import,[min/2]}).
 
22
 
 
23
%% Avoid warning for local function error/1 clashing with autoimported BIF.
 
24
-compile({no_auto_import,[error/1]}).
21
25
-export([file/1, files/1]).
22
26
 
23
27
%% Interface for compiler.
416
420
valfun_1({put_string,Sz,_,Dst}, Vst0) when is_integer(Sz) ->
417
421
    Vst = eat_heap(2*Sz, Vst0),
418
422
    set_type_reg(cons, Dst, Vst);
 
423
%% Instructions for optimization of selective receives.
 
424
valfun_1({recv_mark,{f,Fail}}, Vst) when is_integer(Fail) ->
 
425
    Vst;
 
426
valfun_1({recv_set,{f,Fail}}, Vst) when is_integer(Fail) ->
 
427
    Vst;
419
428
%% Misc.
420
429
valfun_1({'%live',Live}, Vst) ->
421
430
    verify_live(Live, Vst),
604
613
    St = kill_heap_allocation(St0),
605
614
    Vst1 = Vst0#vst{current=St},
606
615
    verify_live(Live, Vst1),
607
 
    Vst2 = prune_x_regs(Live, Vst1),
608
 
    validate_src(Src, Vst2),
609
 
    Vst = branch_state(Fail, Vst2),
 
616
    Vst2 = branch_state(Fail, Vst1),
 
617
    Vst = prune_x_regs(Live, Vst2),
 
618
    validate_src(Src, Vst),
610
619
    Type = bif_type(Op, Src, Vst),
611
620
    set_type_reg(Type, Dst, Vst);
612
621
valfun_4(return, #vst{current=#st{numy=none}}=Vst) ->
752
761
valfun_4({bs_utf16_size,{f,Fail},A,Dst}, Vst) ->
753
762
    assert_term(A, Vst),
754
763
    set_type_reg({integer,[]}, Dst, branch_state(Fail, Vst));
755
 
valfun_4({bs_bits_to_bytes2,Src,Dst}, Vst) ->
756
 
    assert_term(Src, Vst),
757
 
    set_type_reg({integer,[]}, Dst, Vst);
758
764
valfun_4({bs_bits_to_bytes,{f,Fail},Src,Dst}, Vst) ->
759
765
    assert_term(Src, Vst),
760
766
    set_type_reg({integer,[]}, Dst, branch_state(Fail, Vst));