Mercurial > hg-old > index.cgi
comparison lwasm/symbol.c @ 370:6b33faa21a0a
Debugging output and bugfixing pass 0
author | lost@starbug |
---|---|
date | Tue, 20 Apr 2010 21:59:58 -0600 |
parents | d96c30e60ddf |
children | d99322ef6f21 |
comparison
equal
deleted
inserted
replaced
369:898a41f7eb59 | 370:6b33faa21a0a |
---|---|
24 #include <stdlib.h> | 24 #include <stdlib.h> |
25 #include <string.h> | 25 #include <string.h> |
26 | 26 |
27 #include <lw_alloc.h> | 27 #include <lw_alloc.h> |
28 #include <lw_expr.h> | 28 #include <lw_expr.h> |
29 #include <lw_string.h> | |
29 | 30 |
30 #include "lwasm.h" | 31 #include "lwasm.h" |
31 | 32 |
32 struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t val, int flags) | 33 struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t val, int flags) |
33 { | 34 { |
104 as -> symtab.head = se; | 105 as -> symtab.head = se; |
105 se -> context = context; | 106 se -> context = context; |
106 se -> version = version; | 107 se -> version = version; |
107 se -> flags = flags; | 108 se -> flags = flags; |
108 se -> value = lw_expr_copy(val); | 109 se -> value = lw_expr_copy(val); |
110 se -> symbol = lw_strdup(sym); | |
109 return se; | 111 return se; |
110 } | 112 } |
111 | 113 |
112 // for "SET" symbols, always returns the LAST definition of the | 114 // for "SET" symbols, always returns the LAST definition of the |
113 // symbol. This works because the lwasm_reduce_expr() call in | 115 // symbol. This works because the lwasm_reduce_expr() call in |