I really only skimmed your code, but as far as I can tell you never assert any of your pointer arithmetics?
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions. You do have number 1 (via an if-statement) in some places, but I cannot see number 2 anywhere.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
Show differencesHistory of post edits
#5nife87
Posted 11 March 2012 - 05:43 AM
I really only skimmed your code, but as far as I can tell you never assert any of your pointer arithmetics?
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions. You do have number 1 in some places, but I cannot see number 2.
1. Assert that all pointers are valid before usage - either use an if-statement before usage, or assert via assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions. You do have number 1 in some places, but I cannot see number 2.
1. Assert that all pointers are valid before usage - either use an if-statement before usage, or assert via assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
#4nife87
Posted 11 March 2012 - 05:43 AM
I really only skimmed your code, but as far as I can tell you never assert any of your pointer arithmetics? (edit: besides m_model and mesh in loops)
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions. You do have number 1 in some places, but I cannot see number 2.
1. Assert that all pointers are valid before usage - either use an if-statement before usage, or assert via assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions. You do have number 1 in some places, but I cannot see number 2.
1. Assert that all pointers are valid before usage - either use an if-statement before usage, or assert via assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
#3nife87
Posted 11 March 2012 - 05:41 AM
I really only skimmed your code, but as far as I can tell you never assert any of your pointer arithmetics? (edit: besides m_model and mesh in loops)
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
#2nife87
Posted 11 March 2012 - 05:40 AM
I really only skimmed your code, but as far as I can tell you never assert any of your pointer arithmetics? (edit: besides m_model)
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
#1nife87
Posted 11 March 2012 - 05:39 AM
I really only skimmed your code, but as far as I can tell you never assert any of your pointer arithmetics?
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).
And can't you ask the debugger to tell you the precise file name and line instead of your "general" pointer-fault?
Anyways, for the assertions.
1. Assert that all pointers are valid before usage - assert(p != NULL) or assert(p != nullptr).
2. Assert that all array indicies are valid before usage - assert(i < array_size) or, for STL containers, assert (i < container.size()).