143 // Merge its marks and references |
143 // Merge its marks and references |
144 unsigned int u = 0; |
144 unsigned int u = 0; |
145 for (u = 0; u < MAX_MARKS; u++) { |
145 for (u = 0; u < MAX_MARKS; u++) { |
146 if (other->marks[u]) { |
146 if (other->marks[u]) { |
147 // Add the mark and offset its position. |
147 // Add the mark and offset its position. |
148 unsigned int u = AddMark (other->marks[u]->type, other->marks[u]->name); |
148 unsigned int u = AddMark (other->marks[u]->name); |
149 marks[u]->pos += other->writesize; |
149 marks[u]->pos += other->writesize; |
150 } |
150 } |
151 |
151 |
152 if (other->refs[u]) { |
152 if (other->refs[u]) { |
153 // Same for references |
153 // Same for references |
170 // ==================================================================== |
170 // ==================================================================== |
171 // Adds a mark to the buffer. A mark is a "pointer" to a particular |
171 // Adds a mark to the buffer. A mark is a "pointer" to a particular |
172 // position in the bytecode. The actual permanent position cannot |
172 // position in the bytecode. The actual permanent position cannot |
173 // be predicted in any way or form, thus these things will be used |
173 // be predicted in any way or form, thus these things will be used |
174 // to "mark" a position like that for future use. |
174 // to "mark" a position like that for future use. |
175 unsigned int AddMark (int type, str name) { |
175 unsigned int AddMark (str name) { |
176 // Find a free slot for the mark |
176 // Find a free slot for the mark |
177 unsigned int u; |
177 unsigned int u; |
178 for (u = 0; u < MAX_MARKS; u++) |
178 for (u = 0; u < MAX_MARKS; u++) |
179 if (!marks[u]) |
179 if (!marks[u]) |
180 break; |
180 break; |