typeprof 0.21.9 → 0.21.11
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/type.rb +1 -1
- 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: 2fe080a0c812f2be50d024eb51bd7c4ba751c2a720aaa99489e4a6271edba1e2
|
4
|
+
data.tar.gz: 6bd7b34c3428855355ff644ecf9987cda4db8645ba3a495a0f412f25c98a9972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac0242124986985239123f8a15e2cea01c77815cf2a9e5e586178fdece251d0e13172429ea09773d7b5136aed568db4e7e25fadcabb5a7afd000f57454c28b79
|
7
|
+
data.tar.gz: 4b36374f2af922eab5803e77666046896392153475d3dc892cc689e25beb84c83a6b5a164c344768b2d0951ba790832785907d1cf65b1f37cc91d9f1472cf957
|
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.11)
|
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.4)
|
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/type.rb
CHANGED
@@ -921,7 +921,7 @@ module TypeProf
|
|
921
921
|
|
922
922
|
# Dirty Hack: Stop the iteration at most once!
|
923
923
|
# I'll remove this hack if RBS removes the limitation of nesting blocks
|
924
|
-
return fargs_str, sig_help if caller_locations.any? {|frame| frame.label
|
924
|
+
return fargs_str, sig_help if caller_locations.any? {|frame| frame.label =~ /\bshow_block_signature\z/ }
|
925
925
|
|
926
926
|
optional = false
|
927
927
|
blks = []
|
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.11
|
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-19 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
|