summaryrefslogtreecommitdiffstats
path: root/depends/pack200/src/bands.cpp
blob: 6b4e8971eecf1b40b79f3f9154b28c6af87de7f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
/*
 * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

// -*- C++ -*-
// Small program for unpacking specially compressed Java packages.
// John R. Rose

#include <sys/types.h>

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>

#include "defines.h"
#include "bytes.h"
#include "utils.h"
#include "coding.h"
#include "bands.h"

#include "constants.h"
#include "unpack.h"

inline void band::abort(const char *msg)
{
	u->abort(msg);
}
inline bool band::aborting()
{
	return u->aborting();
}

void band::readData(int expectedLength)
{
	CHECK;
	assert(expectedLength >= 0);
	assert(vs[0].cmk == cmk_ERROR);
	if (expectedLength != 0)
	{
		assert(length == 0);
		length = expectedLength;
	}
	if (length == 0)
	{
		assert((rplimit = cm.vs0.rp = u->rp) != nullptr);
		return;
	}
	assert(length > 0);

	bool is_BYTE1 = (defc->spec == BYTE1_spec);

	if (is_BYTE1)
	{
		// No possibility of coding change.  Sizing is exact.
		u->ensure_input(length);
	}
	else
	{
		// Make a conservatively generous estimate of band size in bytes.
		// Assume B == 5 everywhere.
		// Assume awkward pop with all {U} values (2*5 per value)
		jlong generous = (jlong)length * (B_MAX * 3 + 1) + C_SLOP;
		u->ensure_input(generous);
	}

	// Read one value to see what it might be.
	int XB = _meta_default;
	int cp1 = 0, cp2 = 0;
	if (!is_BYTE1)
	{
		// must be a variable-length coding
		assert(defc->B() > 1 && defc->L() > 0);

		value_stream xvs;
		coding *valc = defc;
		if (valc->D() != 0)
		{
			valc = coding::findBySpec(defc->B(), defc->H(), defc->S());
			assert(!valc->isMalloc);
		}
		xvs.init(u->rp, u->rplimit, valc);
		CHECK;
		int X = xvs.getInt();
		if (valc->S() != 0)
		{
			assert(valc->min <= -256);
			XB = -1 - X;
		}
		else
		{
			int L = valc->L();
			assert(valc->max >= L + 255);
			XB = X - L;
		}
		if (0 <= XB && XB < 256)
		{
			// Skip over the escape value.
			u->rp = xvs.rp;
			cp1 = 1;
		}
		else
		{
			// No, it's still default.
			XB = _meta_default;
		}
	}

	if (XB <= _meta_canon_max)
	{
		byte XB_byte = (byte)XB;
		byte *XB_ptr = &XB_byte;
		cm.init(u->rp, u->rplimit, XB_ptr, 0, defc, length, nullptr);
		CHECK;
	}
	else
	{
		assert(u->meta_rp != nullptr);
		// Scribble the initial byte onto the band.
		byte *save_meta_rp = --u->meta_rp;
		byte save_meta_xb = (*save_meta_rp);
		(*save_meta_rp) = (byte)XB;
		cm.init(u->rp, u->rplimit, u->meta_rp, 0, defc, length, nullptr);
		(*save_meta_rp) = save_meta_xb; // put it back, just to be tidy
	}
	rplimit = u->rp;

	rewind();
}

void band::setIndex(cpindex *ix_)
{
	assert(ix_ == nullptr || ixTag == ix_->ixTag);
	ix = ix_;
}
void band::setIndexByTag(byte tag)
{
	setIndex(u->cp.getIndex(tag));
}

entry *band::getRefCommon(cpindex *ix_, bool nullOKwithCaller)
{
	CHECK_0;
	assert(ix_->ixTag == ixTag ||
		   (ixTag == CONSTANT_Literal && ix_->ixTag >= CONSTANT_Integer &&
			ix_->ixTag <= CONSTANT_String));
	int n = vs[0].getInt() - nullOK;
	// Note: band-local nullOK means nullptr encodes as 0.
	// But nullOKwithCaller means caller is willing to tolerate a nullptr.
	entry *ref = ix_->get(n);
	if (ref == nullptr && !(nullOKwithCaller && n == -1))
		abort(n == -1 ? "nullptr ref" : "bad ref");
	return ref;
}

jlong band::getLong(band &lo_band, bool have_hi)
{
	band &hi_band = (*this);
	assert(lo_band.bn == hi_band.bn + 1);
	uint lo = lo_band.getInt();
	if (!have_hi)
	{
		assert(hi_band.length == 0);
		return makeLong(0, lo);
	}
	uint hi = hi_band.getInt();
	return makeLong(hi, lo);
}

int band::getIntTotal()
{
	CHECK_0;
	if (length == 0)
		return 0;
	if (total_memo > 0)
		return total_memo - 1;
	int total = getInt();
	// overflow checks require that none of the addends are <0,
	// and that the partial sums never overflow (wrap negative)
	if (total < 0)
	{
		abort("overflow detected");
		return 0;
	}
	for (int k = length - 1; k > 0; k--)
	{
		int prev_total = total;
		total += vs[0].getInt();
		if (total < prev_total)
		{
			abort("overflow detected");
			return 0;
		}
	}
	rewind();
	total_memo = total + 1;
	return total;
}

int band::getIntCount(int tag)
{
	CHECK_0;
	if (length == 0)
		return 0;
	if (tag >= HIST0_MIN && tag <= HIST0_MAX)
	{
		if (hist0 == nullptr)
		{
			// Lazily calculate an approximate histogram.
			hist0 = U_NEW(int, (HIST0_MAX - HIST0_MIN) + 1);
			CHECK_0;
			for (int k = length; k > 0; k--)
			{
				int x = vs[0].getInt();
				if (x >= HIST0_MIN && x <= HIST0_MAX)
					hist0[x - HIST0_MIN] += 1;
			}
			rewind();
		}
		return hist0[tag - HIST0_MIN];
	}
	int total = 0;
	for (int k = length; k > 0; k--)
	{
		total += (vs[0].getInt() == tag) ? 1 : 0;
	}
	rewind();
	return total;
}

#define INDEX_INIT(tag, nullOK, subindex) ((tag) + (subindex) * SUBINDEX_BIT + (nullOK) * 256)

#define INDEX(tag) INDEX_INIT(tag, 0, 0)
#define NULL_OR_INDEX(tag) INDEX_INIT(tag, 1, 0)
#define SUB_INDEX(tag) INDEX_INIT(tag, 0, 1)
#define NO_INDEX 0

struct band_init
{
	int defc;
	int index;
};

#define BAND_INIT(name, cspec, ix)                                                             \
	{                                                                                          \
		cspec, ix                                                                              \
	}

const band_init all_band_inits[] =
	{
		// BAND_INIT(archive_magic, BYTE1_spec, 0),
		// BAND_INIT(archive_header, UNSIGNED5_spec, 0),
		// BAND_INIT(band_headers, BYTE1_spec, 0),
		BAND_INIT(cp_Utf8_prefix, DELTA5_spec, 0), BAND_INIT(cp_Utf8_suffix, UNSIGNED5_spec, 0),
		BAND_INIT(cp_Utf8_chars, CHAR3_spec, 0), BAND_INIT(cp_Utf8_big_suffix, DELTA5_spec, 0),
		BAND_INIT(cp_Utf8_big_chars, DELTA5_spec, 0), BAND_INIT(cp_Int, UDELTA5_spec, 0),
		BAND_INIT(cp_Float, UDELTA5_spec, 0), BAND_INIT(cp_Long_hi, UDELTA5_spec, 0),
		BAND_INIT(cp_Long_lo, DELTA5_spec, 0), BAND_INIT(cp_Double_hi, UDELTA5_spec, 0),
		BAND_INIT(cp_Double_lo, DELTA5_spec, 0),
		BAND_INIT(cp_String, UDELTA5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(cp_Class, UDELTA5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(cp_Signature_form, DELTA5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(cp_Signature_classes, UDELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(cp_Descr_name, DELTA5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(cp_Descr_type, UDELTA5_spec, INDEX(CONSTANT_Signature)),
		BAND_INIT(cp_Field_class, DELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(cp_Field_desc, UDELTA5_spec, INDEX(CONSTANT_NameandType)),
		BAND_INIT(cp_Method_class, DELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(cp_Method_desc, UDELTA5_spec, INDEX(CONSTANT_NameandType)),
		BAND_INIT(cp_Imethod_class, DELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(cp_Imethod_desc, UDELTA5_spec, INDEX(CONSTANT_NameandType)),
		BAND_INIT(attr_definition_headers, BYTE1_spec, 0),
		BAND_INIT(attr_definition_name, UNSIGNED5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(attr_definition_layout, UNSIGNED5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(ic_this_class, UDELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(ic_flags, UNSIGNED5_spec, 0),
		BAND_INIT(ic_outer_class, DELTA5_spec, NULL_OR_INDEX(CONSTANT_Class)),
		BAND_INIT(ic_name, DELTA5_spec, NULL_OR_INDEX(CONSTANT_Utf8)),
		BAND_INIT(class_this, DELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(class_super, DELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(class_interface_count, DELTA5_spec, 0),
		BAND_INIT(class_interface, DELTA5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(class_field_count, DELTA5_spec, 0),
		BAND_INIT(class_method_count, DELTA5_spec, 0),
		BAND_INIT(field_descr, DELTA5_spec, INDEX(CONSTANT_NameandType)),
		BAND_INIT(field_flags_hi, UNSIGNED5_spec, 0),
		BAND_INIT(field_flags_lo, UNSIGNED5_spec, 0),
		BAND_INIT(field_attr_count, UNSIGNED5_spec, 0),
		BAND_INIT(field_attr_indexes, UNSIGNED5_spec, 0),
		BAND_INIT(field_attr_calls, UNSIGNED5_spec, 0),
		BAND_INIT(field_ConstantValue_KQ, UNSIGNED5_spec, INDEX(CONSTANT_Literal)),
		BAND_INIT(field_Signature_RS, UNSIGNED5_spec, INDEX(CONSTANT_Signature)),
		BAND_INIT(field_metadata_bands, -1, -1), BAND_INIT(field_attr_bands, -1, -1),
		BAND_INIT(method_descr, MDELTA5_spec, INDEX(CONSTANT_NameandType)),
		BAND_INIT(method_flags_hi, UNSIGNED5_spec, 0),
		BAND_INIT(method_flags_lo, UNSIGNED5_spec, 0),
		BAND_INIT(method_attr_count, UNSIGNED5_spec, 0),
		BAND_INIT(method_attr_indexes, UNSIGNED5_spec, 0),
		BAND_INIT(method_attr_calls, UNSIGNED5_spec, 0),
		BAND_INIT(method_Exceptions_N, UNSIGNED5_spec, 0),
		BAND_INIT(method_Exceptions_RC, UNSIGNED5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(method_Signature_RS, UNSIGNED5_spec, INDEX(CONSTANT_Signature)),
		BAND_INIT(method_metadata_bands, -1, -1), BAND_INIT(method_attr_bands, -1, -1),
		BAND_INIT(class_flags_hi, UNSIGNED5_spec, 0),
		BAND_INIT(class_flags_lo, UNSIGNED5_spec, 0),
		BAND_INIT(class_attr_count, UNSIGNED5_spec, 0),
		BAND_INIT(class_attr_indexes, UNSIGNED5_spec, 0),
		BAND_INIT(class_attr_calls, UNSIGNED5_spec, 0),
		BAND_INIT(class_SourceFile_RUN, UNSIGNED5_spec, NULL_OR_INDEX(CONSTANT_Utf8)),
		BAND_INIT(class_EnclosingMethod_RC, UNSIGNED5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(class_EnclosingMethod_RDN, UNSIGNED5_spec,
				  NULL_OR_INDEX(CONSTANT_NameandType)),
		BAND_INIT(class_Signature_RS, UNSIGNED5_spec, INDEX(CONSTANT_Signature)),
		BAND_INIT(class_metadata_bands, -1, -1),
		BAND_INIT(class_InnerClasses_N, UNSIGNED5_spec, 0),
		BAND_INIT(class_InnerClasses_RC, UNSIGNED5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(class_InnerClasses_F, UNSIGNED5_spec, 0),
		BAND_INIT(class_InnerClasses_outer_RCN, UNSIGNED5_spec, NULL_OR_INDEX(CONSTANT_Class)),
		BAND_INIT(class_InnerClasses_name_RUN, UNSIGNED5_spec, NULL_OR_INDEX(CONSTANT_Utf8)),
		BAND_INIT(class_ClassFile_version_minor_H, UNSIGNED5_spec, 0),
		BAND_INIT(class_ClassFile_version_major_H, UNSIGNED5_spec, 0),
		BAND_INIT(class_attr_bands, -1, -1), BAND_INIT(code_headers, BYTE1_spec, 0),
		BAND_INIT(code_max_stack, UNSIGNED5_spec, 0),
		BAND_INIT(code_max_na_locals, UNSIGNED5_spec, 0),
		BAND_INIT(code_handler_count, UNSIGNED5_spec, 0),
		BAND_INIT(code_handler_start_P, BCI5_spec, 0),
		BAND_INIT(code_handler_end_PO, BRANCH5_spec, 0),
		BAND_INIT(code_handler_catch_PO, BRANCH5_spec, 0),
		BAND_INIT(code_handler_class_RCN, UNSIGNED5_spec, NULL_OR_INDEX(CONSTANT_Class)),
		BAND_INIT(code_flags_hi, UNSIGNED5_spec, 0),
		BAND_INIT(code_flags_lo, UNSIGNED5_spec, 0),
		BAND_INIT(code_attr_count, UNSIGNED5_spec, 0),
		BAND_INIT(code_attr_indexes, UNSIGNED5_spec, 0),
		BAND_INIT(code_attr_calls, UNSIGNED5_spec, 0),
		BAND_INIT(code_StackMapTable_N, UNSIGNED5_spec, 0),
		BAND_INIT(code_StackMapTable_frame_T, BYTE1_spec, 0),
		BAND_INIT(code_StackMapTable_local_N, UNSIGNED5_spec, 0),
		BAND_INIT(code_StackMapTable_stack_N, UNSIGNED5_spec, 0),
		BAND_INIT(code_StackMapTable_offset, UNSIGNED5_spec, 0),
		BAND_INIT(code_StackMapTable_T, BYTE1_spec, 0),
		BAND_INIT(code_StackMapTable_RC, UNSIGNED5_spec, INDEX(CONSTANT_Class)),
		BAND_INIT(code_StackMapTable_P, BCI5_spec, 0),
		BAND_INIT(code_LineNumberTable_N, UNSIGNED5_spec, 0),
		BAND_INIT(code_LineNumberTable_bci_P, BCI5_spec, 0),
		BAND_INIT(code_LineNumberTable_line, UNSIGNED5_spec, 0),
		BAND_INIT(code_LocalVariableTable_N, UNSIGNED5_spec, 0),
		BAND_INIT(code_LocalVariableTable_bci_P, BCI5_spec, 0),
		BAND_INIT(code_LocalVariableTable_span_O, BRANCH5_spec, 0),
		BAND_INIT(code_LocalVariableTable_name_RU, UNSIGNED5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(code_LocalVariableTable_type_RS, UNSIGNED5_spec, INDEX(CONSTANT_Signature)),
		BAND_INIT(code_LocalVariableTable_slot, UNSIGNED5_spec, 0),
		BAND_INIT(code_LocalVariableTypeTable_N, UNSIGNED5_spec, 0),
		BAND_INIT(code_LocalVariableTypeTable_bci_P, BCI5_spec, 0),
		BAND_INIT(code_LocalVariableTypeTable_span_O, BRANCH5_spec, 0),
		BAND_INIT(code_LocalVariableTypeTable_name_RU, UNSIGNED5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(code_LocalVariableTypeTable_type_RS, UNSIGNED5_spec,
				  INDEX(CONSTANT_Signature)),
		BAND_INIT(code_LocalVariableTypeTable_slot, UNSIGNED5_spec, 0),
		BAND_INIT(code_attr_bands, -1, -1), BAND_INIT(bc_codes, BYTE1_spec, 0),
		BAND_INIT(bc_case_count, UNSIGNED5_spec, 0), BAND_INIT(bc_case_value, DELTA5_spec, 0),
		BAND_INIT(bc_byte, BYTE1_spec, 0), BAND_INIT(bc_short, DELTA5_spec, 0),
		BAND_INIT(bc_local, UNSIGNED5_spec, 0), BAND_INIT(bc_label, BRANCH5_spec, 0),
		BAND_INIT(bc_intref, DELTA5_spec, INDEX(CONSTANT_Integer)),
		BAND_INIT(bc_floatref, DELTA5_spec, INDEX(CONSTANT_Float)),
		BAND_INIT(bc_longref, DELTA5_spec, INDEX(CONSTANT_Long)),
		BAND_INIT(bc_doubleref, DELTA5_spec, INDEX(CONSTANT_Double)),
		BAND_INIT(bc_stringref, DELTA5_spec, INDEX(CONSTANT_String)),
		BAND_INIT(bc_classref, UNSIGNED5_spec, NULL_OR_INDEX(CONSTANT_Class)),
		BAND_INIT(bc_fieldref, DELTA5_spec, INDEX(CONSTANT_Fieldref)),
		BAND_INIT(bc_methodref, UNSIGNED5_spec, INDEX(CONSTANT_Methodref)),
		BAND_INIT(bc_imethodref, DELTA5_spec, INDEX(CONSTANT_InterfaceMethodref)),
		BAND_INIT(bc_thisfield, UNSIGNED5_spec, SUB_INDEX(CONSTANT_Fieldref)),
		BAND_INIT(bc_superfield, UNSIGNED5_spec, SUB_INDEX(CONSTANT_Fieldref)),
		BAND_INIT(bc_thismethod, UNSIGNED5_spec, SUB_INDEX(CONSTANT_Methodref)),
		BAND_INIT(bc_supermethod, UNSIGNED5_spec, SUB_INDEX(CONSTANT_Methodref)),
		BAND_INIT(bc_initref, UNSIGNED5_spec, SUB_INDEX(CONSTANT_Methodref)),
		BAND_INIT(bc_escref, UNSIGNED5_spec, INDEX(CONSTANT_All)),
		BAND_INIT(bc_escrefsize, UNSIGNED5_spec, 0), BAND_INIT(bc_escsize, UNSIGNED5_spec, 0),
		BAND_INIT(bc_escbyte, BYTE1_spec, 0),
		BAND_INIT(file_name, UNSIGNED5_spec, INDEX(CONSTANT_Utf8)),
		BAND_INIT(file_size_hi, UNSIGNED5_spec, 0), BAND_INIT(file_size_lo, UNSIGNED5_spec, 0),
		BAND_INIT(file_modtime, DELTA5_spec, 0), BAND_INIT(file_options, UNSIGNED5_spec, 0),
		// BAND_INIT(file_bits, BYTE1_spec, 0),
		{0, 0}};
#define NUM_BAND_INITS (sizeof(all_band_inits) / sizeof(all_band_inits[0]))

band *band::makeBands(unpacker *u)
{
	band *tmp_all_bands = U_NEW(band, BAND_LIMIT);
	for (int i = 0; i < BAND_LIMIT; i++)
	{
		assert((byte *)&all_band_inits[i + 1] <
			   (byte *)all_band_inits + sizeof(all_band_inits));
		const band_init &bi = all_band_inits[i];
		band &b = tmp_all_bands[i];
		coding *defc = coding::findBySpec(bi.defc);
		assert((defc == nullptr) == (bi.defc == -1)); // no garbage, please
		assert(defc == nullptr || !defc->isMalloc);
		b.init(u, i, defc);
		if (bi.index > 0)
		{
			b.nullOK = ((bi.index >> 8) & 1);
			b.ixTag = (bi.index & 0xFF);
		}
	}
	return tmp_all_bands;
}

void band::initIndexes(unpacker *u)
{
	band *tmp_all_bands = u->all_bands;
	for (int i = 0; i < BAND_LIMIT; i++)
	{
		band *scan = &tmp_all_bands[i];
		uint tag = scan->ixTag; // Cf. #define INDEX(tag) above
		if (tag != 0 && tag != CONSTANT_Literal && (tag & SUBINDEX_BIT) == 0)
		{
			scan->setIndex(u->cp.getIndex(tag));
		}
	}
}