There are a "theoretical" answer and a "pragmatic" one.
From a theroretical point of view, when a prior is improper the posterior does not exist (well, look at Matthew's answer for a sounder statement), but may be approximated by a limiting form.
If the data comprise a conditionally i.i.d. sample from the Bernoulli distribution with parameter $\theta$, and $\theta$ has the beta distribution with parameters $\alpha$ and $\beta$, the posterior distribution of $\theta$ is the beta distribution with parameters $\alpha + s, \beta+n-s$ ($n$ observations, $s$ successes) and its mean is $(\alpha+s)/(\alpha+\beta+n)$. If we use the improper (and unreal) beta distribution prior with prior hypeparameters $\alpha=\beta=0$, and pretend that $\pi(\theta)\propto\theta^{-1}(1-\theta)^{-1}$, we obtain a proper posterior proportional to $\theta^{s-1}(1-\theta)^{n-s-1}$, i.e. the p.d.f. of the beta distribution with parameters $s$ and $n-s$ except for a constant factor. This is the limiting form of the posterior for a beta prior with parameters $\alpha\to 0$ and $\beta\to 0$ (Degroot & Schervish, Example 7.3.13).
In a normal model with mean $\theta$, known variance $\sigma^2$, and a $\mathcal{N}(\mu_0,\tau^2_0)$ prior distribution for $\theta$, if the prior precision, $1/\tau^2_0$, is small relative to the data precision, $n/\sigma^2$, then the posterior distribution is approximately as if $\tau^2_0=\infty$:
$$p(\theta\mid x)\approx \mathcal{N}(\theta\mid\bar{x},\sigma^2/n)$$
i.e. the posterior distribution is approximately that which would result from assuming $p(\theta)$ is proportional to a constant for $\theta\in(-\infty,\infty)$, a distribution that is not strictly possible, but the limiting form of the posterior as $\tau^2_0$ approaches $\infty$ does exist (Gelman et al., p. 52).
From a "pragmatic" point of view, $p(x\mid\theta)p(\theta)=0$ when
$p(x\mid\theta)=0$ whatever $p(\theta)$ is, so if $p(x\mid\theta)\ne 0$ in
$(a,b)$, then $\int_{-\infty}^{\infty}p(x\mid\theta)p(\theta)d\theta=\int_a^b
p(x\mid\theta)p(\theta)d\theta$. Improper priors may be
employed to represent the local behavior of the prior distribution in the
region where the likelihood is appreciable, say $(a,b)$. By supposing that to a sufficient
approximation a prior follows forms such as $f(x)=k,
x\in(-\infty,\infty)$ or $f(x)=kx^{-1}, x\in(0,\infty)$ only over $(a,b)$,
that it suitably tails to zero outside
that range, we ensure the priors actually used are proper (Box and
Tiao, p. 21). So
if the prior distribution of $\theta$ is $\mathcal{U}(-\infty,\infty)$ but
$(a,b)$ is bounded, it is as if $\theta\sim\mathcal{U}(a,b)$,
i.e. $p(x\mid\theta)p(\theta)=p(x\mid\theta)k\propto p(x\mid\theta)$. For a
concrete example, this is what happens in Stan: if no
prior is specified for a parameter, it is implicitly given a uniform prior on
its support and this is handled as a multiplication of the likelihood by a constant.