2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2024-07-19 11:43:27 -04:00
|
|
|
* Copyright 2001, 2012 Fidelity Information Services, Inc *
|
2012-02-05 11:35:58 -05:00
|
|
|
* *
|
|
|
|
* This source code contains the intellectual property *
|
|
|
|
* of its copyright holder(s), and is made available *
|
|
|
|
* under a license. If you do not know the terms of *
|
|
|
|
* the license, please stop and do not read further. *
|
|
|
|
* *
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#include "mdef.h"
|
|
|
|
#include "gtm_string.h"
|
|
|
|
#include "compiler.h"
|
|
|
|
#include "opcode.h"
|
|
|
|
#include "toktyp.h"
|
|
|
|
#include "indir_enum.h"
|
|
|
|
#include "cache.h"
|
|
|
|
#include "hashtab_mname.h"
|
|
|
|
#include "hashtab_objcode.h"
|
|
|
|
#include "op.h"
|
|
|
|
#include "valid_mname.h"
|
|
|
|
#include "stack_frame.h"
|
|
|
|
#include "stringpool.h"
|
|
|
|
|
|
|
|
GBLREF boolean_t mstr_native_align;
|
|
|
|
GBLREF hash_table_objcode cache_table;
|
|
|
|
GBLREF stack_frame *frame_pointer;
|
|
|
|
|
|
|
|
error_def(ERR_VAREXPECTED);
|
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
/* note: not currently used anywhere */
|
2012-02-05 11:35:58 -05:00
|
|
|
void op_indlvadr(mval *target)
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
char *ptr;
|
|
|
|
icode_str indir_src;
|
|
|
|
int rval;
|
|
|
|
mname_entry *targ_key;
|
|
|
|
mstr *obj, object;
|
|
|
|
mval *saved_indx;
|
|
|
|
oprtype v;
|
|
|
|
triple *s;
|
|
|
|
uint4 align_padlen, len;
|
2012-02-05 11:35:58 -05:00
|
|
|
DCL_THREADGBL_ACCESS;
|
|
|
|
|
|
|
|
SETUP_THREADGBL_ACCESS;
|
|
|
|
MV_FORCE_STR(target);
|
|
|
|
indir_src.str = target->str;
|
|
|
|
indir_src.code = indir_lvadr;
|
|
|
|
saved_indx = NULL;
|
|
|
|
if (NULL == (obj = cache_get(&indir_src)))
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
obj = &object;
|
2024-07-19 11:43:27 -04:00
|
|
|
comp_init(&target->str, NULL);
|
2012-03-24 14:06:46 -04:00
|
|
|
switch (TREF(window_token))
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
case TK_IDENT:
|
2024-07-19 11:43:27 -04:00
|
|
|
rval = lvn(&v, OC_PUTINDX, NULL);
|
2012-02-05 11:35:58 -05:00
|
|
|
break;
|
|
|
|
case TK_ATSIGN:
|
2012-03-24 14:06:46 -04:00
|
|
|
if (EXPR_FAIL != (rval = indirection(&v))) /* NOTE assignment */
|
2024-07-19 11:43:27 -04:00
|
|
|
{
|
2012-02-05 11:35:58 -05:00
|
|
|
s = newtriple(OC_INDLVADR);
|
|
|
|
s->operand[0] = v;
|
|
|
|
v = put_tref(s);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
stx_error(ERR_VAREXPECTED);
|
2012-03-24 14:06:46 -04:00
|
|
|
rval = EXPR_FAIL;
|
2012-02-05 11:35:58 -05:00
|
|
|
break;
|
|
|
|
}
|
2024-07-19 11:43:27 -04:00
|
|
|
if (EXPR_FAIL == comp_fini(rval, obj, OC_IRETMVAD, &v, NULL, target->str.len))
|
2012-03-24 14:06:46 -04:00
|
|
|
return;
|
2024-07-19 11:43:27 -04:00
|
|
|
cache_put(&indir_src, obj);
|
2012-02-05 11:35:58 -05:00
|
|
|
}
|
2012-03-24 14:06:46 -04:00
|
|
|
comp_indr(obj);
|
2012-02-05 11:35:58 -05:00
|
|
|
return;
|
|
|
|
}
|