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 +4 -4
- data/Gemfile.lock +4 -2
- data/lib/typeprof/analyzer.rb +15 -1
- data/lib/typeprof/insns-def.rb +2 -0
- data/lib/typeprof/iseq.rb +7 -2
- data/lib/typeprof/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '06598fbcfb3ce3394271ccc6f97304d4cc902f57eb581c3341865a6a17b9ec27'
|
4
|
+
data.tar.gz: f9359077192046c0dc45884b64af37ddd06586866ad8231d292d5e7d013861ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
15
|
+
rbs (3.4.3)
|
16
|
+
abbrev
|
15
17
|
simplecov (0.21.2)
|
16
18
|
docile (~> 1.1)
|
17
19
|
simplecov-html (~> 0.11)
|
data/lib/typeprof/analyzer.rb
CHANGED
@@ -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
|
data/lib/typeprof/insns-def.rb
CHANGED
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
|
data/lib/typeprof/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|