<commit_before>/*
 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
 *
 *          This product is part of the Amsterdam Compiler Kit.
 *
 * Permission to use, sell, duplicate or disclose this software must be
 * obtained in writing. Requests for such permissions may be sent to
 *
 *      Dr. <NAME>
 *      Wiskundig Seminarium
 *      Vrije Universiteit
 *      Postbox 7161
 *      1007 MC Amsterdam
 *      The Netherlands
 *
 */

#include        "ass00.h"
#include        "assex.h"
#include        "ip_spec.h"

short           opt_line ;      /* max_line_no - # lines removed from end
				   after perfoming exc's.
				   Used to estimate the distance in # of
				   instructions.
				*/
/*
** Determine the exact instruction length & format where possible, and the
** the upper and lower limits otherwise. Enter limits in labeltable
*/
pass_3()
{
	register line_t *lnp, *rev_lnp;
	line_t   *tmp_lnp;
	locl_t   *lbp;
	int      min_l, max_l, min_bytes;
	short    last_line ;
	short    hol_err_line ;
	register insno ;

	pass = 3;
	opt_line= line_num ; hol_err_line=0 ;
	min_bytes = max_bytes = 0; rev_lnp= lnp_cast 0 ;
	for (lnp = pstate.s_fline ; lnp ; opt_line--, line_num-- ) {
		pstate.s_fline= lnp;
		insno = ctrunc(lnp->instr_num);
		switch( insno ) {
		case sp_fpseu :
			last_line = line_num ;
			line_num = lnp->ad.ad_ln.ln_first ;
			opt_line -= lnp->ad.ad_ln.ln_extra ;
			lnp->ad.ad_ln.ln_first= last_line ;
			break ;
		case sp_ilb1 :
			lbp = lnp->ad.ad_lp;
			lbp->l_defined = SEEN;
			lbp->l_min = min_bytes;
			lbp->l_max = max_bytes;
			break ;
		default:
		if ( lnp->type1==CONST && (em_flag[insno]&EM_PAR)==PAR_G ) {
			if (holbase != 0) {
				lnp->ad.ad_i += holbase;
				if (lnp->ad.ad_i >= holsize) {
						hol_err_line= line_num ;
				}
			}
		} else
		if ( lnp->type1>=VALLOW && (em_flag[insno]&EM_PAR)==PAR_G ) {
			if (holbase != 0) {
				pstate.s_fline= lnp->l_next ;
				newline(CONST) ;
				pstate.s_fline->instr_num= insno ;
				pstate.s_fline->ad.ad_i=
					VAL1(lnp->type1)+holbase ;
				freearea((area_t)lnp,
					(unsigned)linesize[VALLOW]) ;
				lnp= pstate.s_fline ;
				if ( VAL1(lnp->type1) >= holsize) {
					hol_err_line= line_num ;
				}
			}
		}
		if ( !valid(lnp) ) fatal("Invalid operand") ;

		determine_props(lnp, &min_l, &max_l);
		min_bytes += min_l; max_bytes += max_l;<commit_msg>The check for a too high offset in a hol is repaired.<commit_after>/*
 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
 *
 *          This product is part of the Amsterdam Compiler Kit.
 *
 * Permission to use, sell, duplicate or disclose this software must be
 * obtained in writing. Requests for such permissions may be sent to
 *
 *      Dr. <NAME>
 *      Wiskundig Seminarium
 *      Vrije Universiteit
 *      Postbox 7161
 *      1007 MC Amsterdam
 *      The Netherlands
 *
 */

#include        "ass00.h"
#include        "assex.h"
#include        "ip_spec.h"

short           opt_line ;      /* max_line_no - # lines removed from end
				   after perfoming exc's.
				   Used to estimate the distance in # of
				   instructions.
				*/
/*
** Determine the exact instruction length & format where possible, and the
** the upper and lower limits otherwise. Enter limits in labeltable
*/
pass_3()
{
	register line_t *lnp, *rev_lnp;
	line_t   *tmp_lnp;
	locl_t   *lbp;
	int      min_l, max_l, min_bytes;
	short    last_line ;
	short    hol_err_line ;
	register insno ;

	pass = 3;
	opt_line= line_num ; hol_err_line=0 ;
	min_bytes = max_bytes = 0; rev_lnp= lnp_cast 0 ;
	for (lnp = pstate.s_fline ; lnp ; opt_line--, line_num-- ) {
		pstate.s_fline= lnp;
		insno = ctrunc(lnp->instr_num);
		switch( insno ) {
		case sp_fpseu :
			last_line = line_num ;
			line_num = lnp->ad.ad_ln.ln_first ;
			opt_line -= lnp->ad.ad_ln.ln_extra ;
			lnp->ad.ad_ln.ln_first= last_line ;
			break ;
		case sp_ilb1 :
			lbp = lnp->ad.ad_lp;
			lbp->l_defined = SEEN;
			lbp->l_min = min_bytes;
			lbp->l_max = max_bytes;
			break ;
		default:
		if ( lnp->type1==CONST && (em_flag[insno]&EM_PAR)==PAR_G ) {
			if (holbase != 0) {
				if (lnp->ad.ad_i >= holsize) {
						hol_err_line= line_num ;
				}
				lnp->ad.ad_i += holbase;
			}
		} else
		if ( lnp->type1>=VALLOW && (em_flag[insno]&EM_PAR)==PAR_G ) {
			if (holbase != 0) {
				pstate.s_fline= lnp->l_next ;
				newline(CONST) ;
				pstate.s_fline->instr_num= insno ;
				pstate.s_fline->ad.ad_i=
					VAL1(lnp->type1)+holbase ;
				freearea((area_t)lnp,
					(unsigned)linesize[VALLOW]) ;
				lnp= pstate.s_fline ;
				if ( VAL1(lnp->type1) >= holsize) {
					hol_err_line= line_num ;
				}
			}
		}
		if ( !valid(lnp) ) fatal("Invalid operand") ;

		determine_props(lnp, &min_l, &max_l);
		min_bytes += min_l; max_bytes += max_l;
{'fraction_non_alphanumeric': 0.12484263533361309, 'fraction_numerical': 0.01174989509022241, 'mean_word_length': 2.692486444616576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7439925', 'n_tokens_mistral': 2121, 'n_tokens_neox': 1872, 'n_words': 432}