[Lldb-commits] [lldb] r202561 - Make sure the exe_ctx passed to ClangUserExpression::Execute has a valid thread.

jingham at apple.com jingham at apple.com
Mon Mar 3 11:10:53 PST 2014


My bad, you should be able to run the JIT code provided it only touches global objects without a thread.  I should have moved the check for having a ThreadScope down to where we were preparing to actually run code, since it is impossible to do that without a valid thread to run on.  I think that's a clearer fix than adding m_can_interpret to the if conditional.  Thanks for catching this.

Jim

On Mar 3, 2014, at 7:55 AM, Ed Maste <emaste at freebsd.org> wrote:

> On 28 February 2014 19:17, Jim Ingham <jingham at apple.com> wrote:
>> Author: jingham
>> Date: Fri Feb 28 18:17:06 2014
>> New Revision: 202561
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=202561&view=rev
>> Log:
>> Make sure the exe_ctx passed to ClangUserExpression::Execute has a valid thread.
>> 
>> <rdar://problem/15949113>
> 
> Hi Jim,
> 
> I saw a couple of test failures after this change.  One of them
> suggests it should be permissible to execute w/o a valid thread if the
> expression can be evaluated statically (and that seems to be
> sensible):
> 
> 1: test_backticks_no_target
> (TestBackticksWithoutATarget.BackticksWithNoTargetTestCase)
>   A simple test of backticks without a target. ... runCmd: print `1+2-3`
> runCmd failed!
> error: ClangUserExpression::Execute called with no thread selected.
> 
> I added a !m_can_interpret to the condition in r202722.  My change
> means we will again call PrepareToExecuteJITExpression and
> FinalizeJITExecution with an exe_ctx with no valid thread, but only
> with a successful IRInterpreter::Interpret call (or we return error
> and do not call FinalizeJITExecution).
> 
> Please let me know if there's more context in rdar 15949113 that makes
> this simple change incorrect and I can try to take a second look.




More information about the lldb-commits mailing list