diff --git a/scip_indexer/SCIPIndexer.cc b/scip_indexer/SCIPIndexer.cc index c64ecefbf..1f5250cf9 100644 --- a/scip_indexer/SCIPIndexer.cc +++ b/scip_indexer/SCIPIndexer.cc @@ -111,6 +111,7 @@ static bool isTemporary(const core::GlobalState &gs, const core::LocalVariable & auto n = var._name; return n == Names::blockPreCallTemp() || n == Names::blockTemp() || n == Names::blockPassTemp() || n == Names::blkArg() || n == Names::blockCall() || n == Names::blockBreakAssign() || n == Names::forTemp() || + n == Names::keepForCfgTemp() || // Insert checks because sometimes temporaries are initialized with a 0 unique value. 😬 n == Names::finalReturn() || n == NameRef::noName() || n == Names::blockCall() || n == Names::selfLocal() || n == Names::unconditional(); diff --git a/test/scip/testdata/rescue.rb b/test/scip/testdata/rescue.rb new file mode 100644 index 000000000..8784d41d0 --- /dev/null +++ b/test/scip/testdata/rescue.rb @@ -0,0 +1,18 @@ +# typed: true + +class MyError < StandardError +end + +def handle(e) + puts e.inspect.to_s +end + +def f + begin + raise 'This exception will be rescued!' + rescue MyError => e1 + handle(e1) + rescue StandardError => e2 + handle(e2) + end +end diff --git a/test/scip/testdata/rescue.snapshot.rb b/test/scip/testdata/rescue.snapshot.rb new file mode 100644 index 000000000..7e7a7cba5 --- /dev/null +++ b/test/scip/testdata/rescue.snapshot.rb @@ -0,0 +1,34 @@ + # typed: true + + class MyError < StandardError +# ^^^^^^^ definition [..] MyError# +# ^^^^^^^^^^^^^ definition [..] StandardError# + end + + def handle(e) +#^^^^^^^^^^^^^ definition [..] Object#handle(). +# ^ definition local 1~#780127187 + puts e.inspect.to_s +# ^ reference local 1~#780127187 + end + + def f +#^^^^^ definition [..] Object#f(). + begin + raise 'This exception will be rescued!' + rescue MyError => e1 +# ^^^^^^^ reference local 1~#3809224601 +# ^^^^^^^ reference [..] MyError# +# ^^ definition local 1~#3809224601 + handle(e1) +# ^^^^^^ reference [..] Object#handle(). +# ^^ reference local 1~#3809224601 + rescue StandardError => e2 +# ^^^^^^^^^^^^^ reference local 2~#3809224601 +# ^^^^^^^^^^^^^ reference [..] StandardError# +# ^^ definition local 2~#3809224601 + handle(e2) +# ^^^^^^ reference [..] Object#handle(). +# ^^ reference local 2~#3809224601 + end + end