mojoshader_assembler.c
changeset 567 1a61d0cf86ba
parent 566 6bd82a5acf62
child 570 af6bb8728f9e
--- a/mojoshader_assembler.c	Wed Feb 11 21:40:41 2009 -0500
+++ b/mojoshader_assembler.c	Thu Feb 12 01:06:26 2009 -0500
@@ -106,14 +106,8 @@
             error_position = -2;
             break;
         case MOJOSHADER_PARSEPHASE_WORKING:
-            // !!! FIXME: fname == base source file if output_pos == 0.
-            if (ctx->output_len > 0)
-            {
-                const size_t idx = ctx->output_len - 1;
-                linenum = ctx->token_to_source[idx].line;
-                fname = ctx->token_to_source[idx].filename;
-            } // if
-            error_position = linenum;
+            fname = preprocessor_sourcepos(ctx->preprocessor, &linenum);
+            error_position = (int) linenum;
             break;
         case MOJOSHADER_PARSEPHASE_DONE:
             error_position = -1;