https://github.com/JuliaLang/julia
Revision b0b9fcf5826ae4c986a1bbb0529403eb211fcb36 authored by Chris Foster on 01 July 2020, 02:20:06 UTC, committed by KristofferC on 08 July 2020, 12:49:35 UTC
When using `return` or `break` nested inside `finally` handlers,
exception stack lowering failed to pop exceptions from the stack
correctly:

* For `return`, the exception stack was not popped at all. If done
  inside a loop this could eventually cause the runtime to run out of
  memory.
* For `break`, the exception stack was popped too early, causing subtle
  inconsistency in intermediate finally handlers.

Fix these issues by storing the current exception token stack with the
current finally handler information and using it to pop the stack before
jumping into the finally block.

Fixes #34579

(cherry picked from commit 16ba0dd6ee1b9d3fb5e9408be60af8e4b80dda93)
1 parent b04654b
Raw File
Tip revision: b0b9fcf5826ae4c986a1bbb0529403eb211fcb36 authored by Chris Foster on 01 July 2020, 02:20:06 UTC
Fix exception stack lowering in finally handlers (#36480)
Tip revision: b0b9fcf
CITATION.bib
% This article is the definitive citation for Julia.
@article{Julia-2017,
    title={Julia: A fresh approach to numerical computing},
    author={Bezanson, Jeff and Edelman, Alan and Karpinski, Stefan and Shah, Viral B},
    journal={SIAM {R}eview},
    volume={59},
    number={1},
    pages={65--98},
    year={2017},
    publisher={SIAM},
    doi={10.1137/141000671}
}

% The following citations are about specific aspects of Julia.

@article{Julia-2019-a,
   author = {Bezanson, Jeff and Chen, Jiahao and Chung, Benjamin and Karpinski, Stefan and Shah, Viral B. and Vitek, Jan and Zoubritzky, Lionel},
   title = {Julia: Dynamism and Performance Reconciled by Design},
   journal = {Proc. ACM Program. Lang.},
   issue_date = {November 2018},
   volume = {2},
   number = {OOPSLA},
   month = oct,
   year = {2018},
   issn = {2475-1421},
   pages = {120:1--120:23},
   articleno = {120},
   numpages = {23},
   url = {http://doi.acm.org/10.1145/3276490},
   doi = {10.1145/3276490},
   acmid = {3276490},
   publisher = {ACM},
   address = {New York, NY, USA},
   keywords = {dynamic languages, just-in-time compilation, multiple dispatch},
} 

@article{Julia-2019-b,
   author = {Zappa Nardelli, Francesco and Belyakova, Julia and Pelenitsyn, Artem and Chung, Benjamin and Bezanson, Jeff and Vitek, Jan},
   title = {Julia Subtyping: A Rational Reconstruction},
   journal = {Proc. ACM Program. Lang.},
   issue_date = {November 2018},
   volume = {2},
   number = {OOPSLA},
   month = oct,
   year = {2018},
   issn = {2475-1421},
   pages = {113:1--113:27},
   articleno = {113},
   numpages = {27},
   url = {http://doi.acm.org/10.1145/3276483},
   doi = {10.1145/3276483},
   acmid = {3276483},
   publisher = {ACM},
   address = {New York, NY, USA},
   keywords = {Multiple Dispatch, Subtyping},
} 

@inproceedings{Julia-2014,
   author = {Bezanson, Jeff and Chen, Jiahao and Karpinski, Stefan and Shah, Viral and Edelman, Alan},
   title = {Array Operators Using Multiple Dispatch: A Design Methodology for Array Implementations in Dynamic Languages},
   booktitle = {Proceedings of ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming},
   series = {ARRAY'14},
   year = {2014},
   isbn = {978-1-4503-2937-8},
   location = {Edinburgh, United Kingdom},
   pages = {56:56--56:61},
   articleno = {56},
   numpages = {6},
   url = {http://doi.acm.org/10.1145/2627373.2627383},
   doi = {10.1145/2627373.2627383},
   acmid = {2627383},
   publisher = {ACM},
   address = {New York, NY, USA},
   keywords = {Julia, array indexing, dynamic dispatch, multiple dispatch, static analysis, type inference},
} 
back to top