I've updated my bindings with another simpler example -

[https://github.com/zacharycarter/nuklear-nim/blob/master/testNuklear2.nim](https://github.com/zacharycarter/nuklear-nim/blob/master/testNuklear2.nim)

I've removed all the GLFW code, and now the code is failing here -
    
    
    NK_INTERN struct nk_window*
    nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name)
    {
        struct nk_window *iter;
        iter = ctx->begin;
        while (iter) {
            NK_ASSERT(iter != iter->next);
            if (iter->name == hash) { <--- HERE line 17159 of nuklear.h
                int max_len = nk_strlen(iter->name_string);
                if (!nk_stricmpn(iter->name_string, name, max_len))
                    return iter;
            }
            iter = iter->next;
        }
        return 0;
    }
    

So it's failing on line 17159 of nuklear.h because iter which is initialized to 
ctx->begin is nil, however the while loop fails to skip since in reality 
ctx->begin is nil and a check in the nim test of 
    
    
    echo repr ctx.begin
    

confirms that.

Still no idea what's going on here. I was able to get passed my initial problem 
simply by removing the assert and changing the line below to not check if 
ctx->current is null.

Something is still very broken here since all these null checks in C are 
failing.

Reply via email to