<div dir="ltr"><div>Please review the attached patch. <br></div><div><br></div><div>Ashok, thanks for the pre-review comments, please provide if you have more comments.</div><div>I am planning to add test cases after this get patch get committed.<br>
</div><div><br></div><div>Compiles and works fine on Ubuntu 13.04. </div><div>Here is the sample output:</div><div><br></div><div>$lldb a.out -c core </div><div>Core file '/usr/build/llvm/core' (x86_64) was loaded.</div>
<div>Process 0 stopped</div><div>* thread #1: tid = 0x0000, 0x0000000000400570 a.out`recursive_function(i=10) + 44 at test.c:60, name = 'a.out, stop reason = signal SIGSEGV</div><div> frame #0: 0x0000000000400570 a.out`recursive_function(i=10) + 44 at test.c:60</div>
<div> 57 recursive_function(i+1);</div><div> 58 } else {</div><div> 59 char *crash=0;</div><div>-> 60 *crash = 0;</div><div> 61 }</div><div> 62 }</div><div> 63 </div>
<div><br></div><div><div>(lldb) bt</div><div>* thread #1: tid = 0x0000, 0x0000000000400570 a.out`recursive_function(i=10) + 44 at test.c:60, name = 'a.out, stop reason = signal SIGSEGV</div><div> frame #0: 0x0000000000400570 a.out`recursive_function(i=10) + 44 at test.c:60</div>
<div> frame #1: 0x0000000000400562 a.out`recursive_function(i=9) + 30 at test.c:57</div><div> frame #2: 0x0000000000400562 a.out`recursive_function(i=8) + 30 at test.c:57</div><div> frame #3: 0x0000000000400562 a.out`recursive_function(i=7) + 30 at test.c:57</div>
<div> frame #4: 0x0000000000400562 a.out`recursive_function(i=6) + 30 at test.c:57</div><div> frame #5: 0x0000000000400562 a.out`recursive_function(i=5) + 30 at test.c:57</div><div> frame #6: 0x0000000000400562 a.out`recursive_function(i=4) + 30 at test.c:57</div>
<div> frame #7: 0x0000000000400562 a.out`recursive_function(i=3) + 30 at test.c:57</div><div> frame #8: 0x0000000000400562 a.out`recursive_function(i=2) + 30 at test.c:57</div><div> frame #9: 0x0000000000400562 a.out`recursive_function(i=1) + 30 at test.c:57</div>
<div> frame #10: 0x0000000000400562 a.out`recursive_function(i=0) + 30 at test.c:57</div><div> frame #11: 0x00000000004005a7 a.out`static_function + 50 at test.c:68</div><div> frame #12: 0x00000000004005b5 a.out`call_me6 + 14 at test.c:77</div>
<div> frame #13: 0x00000000004005c3 a.out`call_me5 + 14 at test.c:80</div><div> frame #14: 0x00000000004005d3 a.out`call_me4 + 14 at test.c:81</div><div> frame #15: 0x00000000004005e3 a.out`call_me3 + 14 at test.c:82</div>
<div> frame #16: 0x00000000004005f3 a.out`call_me2 + 14 at test.c:83</div><div> frame #17: 0x0000000000400603 a.out`call_me1 + 14 at test.c:84</div><div> frame #18: 0x0000000000400613 a.out`call_me + 14 at test.c:89</div>
<div> frame #19: 0x0000000000400670 a.out`test_func(para1=0x00000000020a1010) + 91 at test.c:108</div><div> frame #20: 0x000000000040070b a.out`main(argc=1, argv=0x00007fffba029498) + 145 at test.c:128</div></div><div>
<br></div><div>Thanks</div><div>Samuel</div></div>