Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect JL_GC_POP #20836

Merged
merged 1 commit into from
Feb 28, 2017
Merged

Remove incorrect JL_GC_POP #20836

merged 1 commit into from
Feb 28, 2017

Conversation

Keno
Copy link
Member

@Keno Keno commented Feb 28, 2017

Static analysis claims:

/home/keno/julia/src/ast.c:196:13: warning: Passing non-rooted value as argument to function that may GC
            jl_method_error((jl_function_t*)margs[0], margs, nargs, world);
            ^               ~~~~~~~~~~~~~~~~~~~~~~~~
/home/keno/julia/src/ast.c:179:9: note: Assuming 'nargs' is >= 1
    if (nargs < 1)
        ^~~~~~~~~
/home/keno/julia/src/ast.c:179:5: note: Taking false branch
    if (nargs < 1)
    ^
/home/keno/julia/src/ast.c:186:14: note: Assuming 'i' is >= 'nargs'
    for(i=1; i < nargs; i++) margs[i] = scm_to_julia(fl_ctx, args[i], 1);
             ^~~~~~~~~
/home/keno/julia/src/ast.c:186:5: note: Loop condition is false. Execution continues on line 187
    for(i=1; i < nargs; i++) margs[i] = scm_to_julia(fl_ctx, args[i], 1);
    ^
/home/keno/julia/src/ast.c:194:13: note: Assuming 'mfunc' is equal to NULL
        if (mfunc == NULL) {
            ^~~~~~~~~~~~~
/home/keno/julia/src/ast.c:194:9: note: Taking true branch
        if (mfunc == NULL) {
        ^
/home/keno/julia/src/ast.c:196:45: note: Started tracking value here
            jl_method_error((jl_function_t*)margs[0], margs, nargs, world);
                                            ^~~~~~~~
/home/keno/julia/src/ast.c:196:13: note: Passing non-rooted value as argument to function that may GC
            jl_method_error((jl_function_t*)margs[0], margs, nargs, world);
            ^               ~~~~~~~~~~~~~~~~~~~~~~~~

May or may not be reachable from julia code, but good to fix anyway.

jl_method_error roots all margs other than margs[0], so margs[0] could have been GCed.
Fix that by removing the JL_GC_POP
@ararslan ararslan added the GC Garbage collector label Feb 28, 2017
@yuyichao yuyichao merged commit b59abda into master Feb 28, 2017
@yuyichao yuyichao deleted the kf/poppop branch February 28, 2017 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants