public Varnode extendValue(Varnode out, Varnode[] in, boolean signExtend,
			ContextEvaluator evaluator) {
		Varnode vnodeVal;

		vnodeVal = getValue(in[0], signExtend, evaluator);
		if (vnodeVal == null) {
			return null;
		}

		if (isConstant(vnodeVal) && in[0].getSize() < out.getSize()) {
			if (vnodeVal.getSize() <= 8) {
				Scalar sVal = new Scalar(8 * vnodeVal.getSize(), vnodeVal.getOffset(), signExtend);
				vnodeVal = createVarnode(sVal.getValue(), vnodeVal.getSpace(), out.getSize());
			}
			else {
				// too big anyway,already extended as far as it will go.
				vnodeVal = createVarnode(vnodeVal.getOffset(), vnodeVal.getSpace(), out.getSize());
			}
		}
		else if (vnodeVal.isRegister() && vnodeVal.getSize() < out.getSize()) {
			Register reg = getRegister(vnodeVal);
			if (reg == null) {
				return null;
			}
			int spaceID = getAddressSpace(reg.getName(),reg.getBitLength());
			vnodeVal = createVarnode(0, spaceID, out.getSize());
		}
		return vnodeVal;
	}
Extend a constant value if it can be extended.

@param out varnode to extend into (for size)
@param in varnode value to extend the size
@return new sign extended varnode
Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java