summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-11 20:22:30 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-11 20:22:30 +0200
commitffcfddc759e583471a1ed55e0938d042bf68c507 (patch)
treea95c6cf4c4e1f75de9a183312c6d0d0f968e849d /src/testdir
parentc72bdd28ac5fe079825155930af8e792580139bb (diff)
patch 8.2.3151: Vim9: profiling fails if nested function is also profiledv8.2.3151
Problem: Vim9: profiling fails if nested function is also profiled. Solution: Use the compile type from the outer function. (closes #8543)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_vim9_script.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index 10f41c7bf8..b4107e97d1 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -4190,6 +4190,14 @@ def ProfiledNested()
Nested()
enddef
+def ProfiledNestedProfiled()
+ var x = 0
+ def Nested(): any
+ return x
+ enddef
+ Nested()
+enddef
+
" Execute this near the end, profiling doesn't stop until Vim exists.
" This only tests that it works, not the profiling output.
def Test_xx_profile_with_lambda()
@@ -4198,8 +4206,17 @@ def Test_xx_profile_with_lambda()
profile start Xprofile.log
profile func ProfiledWithLambda
ProfiledWithLambda()
+
profile func ProfiledNested
ProfiledNested()
+
+ # Also profile the nested function. Use a different function, although the
+ # contents is the same, to make sure it was not already compiled.
+ profile func *
+ ProfiledNestedProfiled()
+
+ profdel func *
+ profile pause
enddef
" Keep this last, it messes up highlighting.