function luaK.exp2reg(u,J,Y,U)u:discharge2reg(J,Y,U)if Y.k=="\086\074\077\080"then Y.t=u:concat(J,Y.t,Y.info)end if u:hasjumps(Y)then local e local Z=u.NO_JUMP local V=u.NO_JUMP if u:need_value(J,Y.t)or u:need_value(J,Y.f)then local e=Y.k=="\086\074\077\080"and u.NO_JUMP or u:jump(J)Z=u:code_label(J,U,0,1)V=u:code_label(J,U,1,0)u:patchtohere(J,e)end e=u:getlabel(J)u:patchlistaux(J,Y.f,e,U,Z)u:patchlistaux(J,Y.t,e,U,V)end Y.f,Y.t=u.NO_JUMP,u.NO_JUMP Y.info=U Y.k="\086\078\079\078\082\069\076\079\067"end
------------------------------------------------------------------------
--
-- * used in luaK:exp2nextreg(), luaK:exp2anyreg(), luaK:storevar()
------------------------------------------------------------------------
function luaK:exp2reg(fs, e, reg)
	self:discharge2reg(fs, e, reg)
	if e.k == "VJMP" then
		e.t = self:concat(fs, e.t, e.info) -- put this jump in 't' list
	end
	if self:hasjumps(e) then
		local final -- position after whole expression
		local p_f = self.NO_JUMP -- position of an eventual LOAD false
		local p_t = self.NO_JUMP -- position of an eventual LOAD true
		if self:need_value(fs, e.t) or self:need_value(fs, e.f) then
			local fj = (e.k == "VJMP") and self.NO_JUMP or self:jump(fs)
			p_f = self:code_label(fs, reg, 0, 1)
			p_t = self:code_label(fs, reg, 1, 0)
			self:patchtohere(fs, fj)
		end
		final = self:getlabel(fs)
		self:patchlistaux(fs, e.f, final, reg, p_f)
		self:patchlistaux(fs, e.t, final, reg, p_t)
	end
	e.f, e.t = self.NO_JUMP, self.NO_JUMP
	e.info = reg
	e.k = "VNONRELOC"
end
