mojoshader_assembler.c
changeset 576 d7ec39b7abab
parent 575 70bb1ba99a07
child 578 6c8f73c845e7
--- a/mojoshader_assembler.c	Thu Feb 12 02:03:18 2009 -0500
+++ b/mojoshader_assembler.c	Thu Feb 12 02:18:24 2009 -0500
@@ -1875,6 +1875,8 @@
             if (error->error_position >= 0)
             {
                 assert(retval != &MOJOSHADER_out_of_mem_data);
+                assert((error->error_position % sizeof (uint32)) == 0);
+
                 const int pos = error->error_position / sizeof (uint32);
                 if (pos >= ctx->output_len)
                     error->error_position = -1;  // oh well.
@@ -1884,11 +1886,8 @@
                     Free(ctx, (void *) error->filename);
                     char *fname = NULL;
                     if (srcpos->filename != NULL)
-                    {
                         fname = StrDup(ctx, srcpos->filename);
-                        if (fname != NULL)
-                            error->error_position = srcpos->line;
-                    } // if
+                    error->error_position = srcpos->line;
                     error->filename = fname;  // may be NULL, that's okay.
                 } // else
             } // if