typeprof 0.21.9 → 0.21.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f679437d629955ec31b3467826bd4114be2b02786bd31b15736681e52d8d01a
4
- data.tar.gz: 8bd7c6403e4c7254e2de29a6d7515bd134996967266a138e2b11ca0834d604c3
3
+ metadata.gz: '06598fbcfb3ce3394271ccc6f97304d4cc902f57eb581c3341865a6a17b9ec27'
4
+ data.tar.gz: f9359077192046c0dc45884b64af37ddd06586866ad8231d292d5e7d013861ec
5
5
  SHA512:
6
- metadata.gz: 2ea5197a66f4672a7804b6994d9613b09c55c000024aa78231a29cf6f531e398e507dc50b3fa0ac51f99ca1c64a6b259eee853421209fcc1034748d06f64c6b0
7
- data.tar.gz: a334eafef1cb1a808066f2e11862d6af634d38f5360b100699e30d19551213fd8d2b5763f4fd31c3a32273441e1753f15fbb956b7f00856745f678f024f93f70
6
+ metadata.gz: 3c72b7cf70f321c75b42f2addacfa2a27f9cfa3f5c010ae0b430e3385e3d3befaf749a190d57d9228976afa48e56d91d8a8abab2823c69401c17dd8523ee2697
7
+ data.tar.gz: 1cfc46a0c0ac7bd5e7ec96c6a8f9e24c4854daa1ec1c830a0eb5af0348d2271865ca65400dca12cd892b6e33fd9929fae41d379064a1dceabc2d8dbf96292243
data/Gemfile.lock CHANGED
@@ -1,17 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- typeprof (0.21.8)
4
+ typeprof (0.21.10)
5
5
  rbs (>= 1.8.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ abbrev (0.1.2)
10
11
  coverage-helpers (1.0.0)
11
12
  docile (1.4.0)
12
13
  power_assert (2.0.1)
13
14
  rake (13.0.1)
14
- rbs (3.2.0)
15
+ rbs (3.4.3)
16
+ abbrev
15
17
  simplecov (0.21.2)
16
18
  docile (~> 1.1)
17
19
  simplecov-html (~> 0.11)
@@ -2137,7 +2137,7 @@ module TypeProf
2137
2137
  end
2138
2138
  end
2139
2139
  return
2140
- when :concatarray
2140
+ when :concatarray, :concattoarray
2141
2141
  env, (ary1, ary2) = env.pop(2)
2142
2142
  if ary1.is_a?(Type::Local) && ary1.kind == Type::Array
2143
2143
  elems1 = get_container_elem_types(env, ep, ary1.id)
@@ -2156,6 +2156,20 @@ module TypeProf
2156
2156
  env, ty = localize_type(ty, env, ep)
2157
2157
  env = env.push(ty)
2158
2158
  end
2159
+ when :pushtoarray
2160
+ num, = operands
2161
+ env, (ary, ty, *tys) = env.pop(num + 1)
2162
+ if ary.is_a?(Type::Local) && ary.kind == Type::Array
2163
+ tys.each {|ty0| ty = ty.union(ty0) }
2164
+ elems = get_container_elem_types(env, ep, ary.id)
2165
+ elems = Type::Array::Elements.new([], elems.squash.union(ty))
2166
+ env = update_container_elem_types(env, ep, ary.id, ary.base_type) { elems }
2167
+ env = env.push(ary)
2168
+ else
2169
+ elems = Type::Array::Elements.new([], Type.any)
2170
+ env = update_container_elem_types(env, ep, ary.id, ary.base_type) { elems }
2171
+ env = env.push(ary)
2172
+ end
2159
2173
 
2160
2174
  when :checktype
2161
2175
  kind, = operands
@@ -32,6 +32,8 @@ TypeProf::INSN_TABLE = {:nop=>[],
32
32
  :duphash=>["VALUE"],
33
33
  :expandarray=>["rb_num_t", "rb_num_t"],
34
34
  :concatarray=>[],
35
+ :concattoarray=>[],
36
+ :pushtoarray=>["rb_num_t"],
35
37
  :splatarray=>["VALUE"],
36
38
  :newhash=>["rb_num_t"],
37
39
  :newrange=>["rb_num_t"],
data/lib/typeprof/iseq.rb CHANGED
@@ -276,7 +276,7 @@ module TypeProf
276
276
  misc[:def_node_id] = node_id
277
277
  end
278
278
  end
279
- ninsns << Insn.new(insn, operands, lineno, code_range, nil)
279
+ ninsns << i = Insn.new(insn, operands, lineno, code_range, nil)
280
280
  else
281
281
  raise "unknown iseq entry: #{ e }"
282
282
  end
@@ -840,10 +840,15 @@ module TypeProf
840
840
  sp -= 1
841
841
  return nil if sp <= 0
842
842
  sp += num + (splat ? 1 : 0)
843
- when :concatarray
843
+ when :concatarray, :concattoarray
844
844
  sp -= 2
845
845
  return nil if sp <= 0
846
846
  sp += 1
847
+ when :pushtoarray
848
+ num, = operands
849
+ sp -= num + 1
850
+ return nil if sp <= 0
851
+ sp += 1
847
852
  when :checktype
848
853
  sp -= 1
849
854
  return nil if sp <= 0
@@ -1,3 +1,3 @@
1
1
  module TypeProf
2
- VERSION = "0.21.9"
2
+ VERSION = "0.21.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typeprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.9
4
+ version: 0.21.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Endoh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-21 00:00:00.000000000 Z
11
+ date: 2024-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.5.1
92
+ rubygems_version: 3.6.0.dev
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: TypeProf is a type analysis tool for Ruby code based on abstract interpretation