Commit 9cb45a9
committed
[MERGE chakra-core#728] Fixing a potential OOM point
Merge pull request chakra-core#728 from rajatd:OOM
I stumbled across this piece of code while inestigating another issue. We are calling CloneIfStaticExceptionObject inside a catch. This could potentially throw OOM if the caught exception was an out of memory exception. Changing the code here to conform to the pattern used at other places - save the exception object in a local and take action on that local outside the catch. This reduces the chances of an OOM being thrown as the stack would have been unwound when we get outside the catch block.1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4810 | 4810 | | |
4811 | 4811 | | |
4812 | 4812 | | |
| 4813 | + | |
4813 | 4814 | | |
4814 | 4815 | | |
4815 | 4816 | | |
4816 | | - | |
| 4817 | + | |
| 4818 | + | |
4817 | 4819 | | |
4818 | | - | |
4819 | | - | |
4820 | | - | |
4821 | | - | |
4822 | | - | |
4823 | | - | |
4824 | | - | |
| 4820 | + | |
| 4821 | + | |
| 4822 | + | |
| 4823 | + | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
4825 | 4830 | | |
4826 | 4831 | | |
4827 | 4832 | | |
| |||
0 commit comments